diff options
author | vanhauser-thc <vh@thc.org> | 2023-01-19 22:24:24 +0100 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2023-01-19 22:24:24 +0100 |
commit | 67cfe4f6d4a03c596a5c3e1aa97d64d79263746a (patch) | |
tree | 15ac1e3490ea601fe607ba441969d57580542be7 /custom_mutators/autotokens/autotokens.cpp | |
parent | 628b4b60021a0d62a2eccddca4fe321c9d57c663 (diff) | |
download | afl++-67cfe4f6d4a03c596a5c3e1aa97d64d79263746a.tar.gz |
nits
Diffstat (limited to 'custom_mutators/autotokens/autotokens.cpp')
-rw-r--r-- | custom_mutators/autotokens/autotokens.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/custom_mutators/autotokens/autotokens.cpp b/custom_mutators/autotokens/autotokens.cpp index f4b96c7b..16ee8109 100644 --- a/custom_mutators/autotokens/autotokens.cpp +++ b/custom_mutators/autotokens/autotokens.cpp @@ -544,7 +544,15 @@ extern "C" unsigned char afl_custom_queue_get(void *data, string input; input.resize(len); rewind(fp); - fread((void *)input.data(), input.size(), 1, fp); + + if (fread((void *)input.data(), 1, len, fp) != len) { + + s = NULL; + DEBUGF(stderr, "Too short read %s\n", len, filename); + return 0; + + } + fclose(fp); if (!afl_ptr->shm.cmplog_mode) { |