diff options
author | van Hauser <vh@thc.org> | 2021-07-19 10:31:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 10:31:56 +0200 |
commit | 939729e504ea269dd6d7252c363b160e01d1be1a (patch) | |
tree | 808710139e53d9958cdb660d61680d48e64e8c3a /instrumentation/afl-llvm-dict2file.so.cc | |
parent | 458eb0813a6f7d63eed97f18696bca8274533123 (diff) | |
parent | 18fd97fc5ffc5ad94e735cfbfa0d500463dcb585 (diff) | |
download | afl++-939729e504ea269dd6d7252c363b160e01d1be1a.tar.gz |
Merge pull request #1023 from AFLplusplus/dev
push to stable
Diffstat (limited to 'instrumentation/afl-llvm-dict2file.so.cc')
-rw-r--r-- | instrumentation/afl-llvm-dict2file.so.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/instrumentation/afl-llvm-dict2file.so.cc b/instrumentation/afl-llvm-dict2file.so.cc index e2b44b21..9daa75a8 100644 --- a/instrumentation/afl-llvm-dict2file.so.cc +++ b/instrumentation/afl-llvm-dict2file.so.cc @@ -154,6 +154,7 @@ bool AFLdict2filePass::runOnModule(Module &M) { for (auto &F : M) { if (isIgnoreFunction(&F)) continue; + if (!isInInstrumentList(&F) || !F.size()) { continue; } /* Some implementation notes. * @@ -428,6 +429,12 @@ bool AFLdict2filePass::runOnModule(Module &M) { uint64_t literalLength = Str2.length(); uint64_t optLength = ilen->getZExtValue(); + if (optLength > literalLength + 1) { + + optLength = Str2.length() + 1; + + } + if (literalLength + 1 == optLength) { Str2.append("\0", 1); // add null byte @@ -534,7 +541,12 @@ bool AFLdict2filePass::runOnModule(Module &M) { uint64_t literalLength = optLen; optLen = ilen->getZExtValue(); - if (optLen > thestring.length()) { optLen = thestring.length(); } + if (optLen > thestring.length() + 1) { + + optLen = thestring.length() + 1; + + } + if (optLen < 2) { continue; } if (literalLength + 1 == optLen) { // add null byte thestring.append("\0", 1); |