diff options
author | vanhauser-thc <vh@thc.org> | 2022-02-20 19:51:43 +0100 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2022-02-20 19:51:43 +0100 |
commit | 92db44363543b510b7737d51ea2b9a4e790bfb07 (patch) | |
tree | 0047ceef4707aad6bc5fce9638ed8d2e24a7b808 /instrumentation/afl-llvm-dict2file.so.cc | |
parent | a5943dc782d1a6047aaa8f455ab37e4a31369311 (diff) | |
download | afl++-92db44363543b510b7737d51ea2b9a4e790bfb07.tar.gz |
Revert "remove new llvm pass manager :("
This reverts commit 55ed2a443c5c61baba37415d4087164454d8a2a8.
Diffstat (limited to 'instrumentation/afl-llvm-dict2file.so.cc')
-rw-r--r-- | instrumentation/afl-llvm-dict2file.so.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/instrumentation/afl-llvm-dict2file.so.cc b/instrumentation/afl-llvm-dict2file.so.cc index 39124660..440b9428 100644 --- a/instrumentation/afl-llvm-dict2file.so.cc +++ b/instrumentation/afl-llvm-dict2file.so.cc @@ -589,7 +589,6 @@ bool AFLdict2filePass::runOnModule(Module &M) { if (optLen < 2) { continue; } if (literalLength + 1 == optLen) { // add null byte - thestring.append("\0", 1); } @@ -612,11 +611,17 @@ bool AFLdict2filePass::runOnModule(Module &M) { } */ - if (!isStdString && thestring.find('\0', 0) != std::string::npos) { + + if (!isStdString) { // ensure we do not have garbage size_t offset = thestring.find('\0', 0); - if (offset + 1 < optLen) optLen = offset + 1; + if (offset && offset < optLen && offset + 1 < optLen) { + + optLen = offset + 1; + + } + thestring = thestring.substr(0, optLen); } |