about summary refs log tree commit diff
path: root/instrumentation/afl-llvm-dict2file.so.cc
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-07-19 10:58:19 +0200
committervanhauser-thc <vh@thc.org>2021-07-19 10:58:19 +0200
commit32a0d6ac31554a47dca591f8978982758fb87677 (patch)
treebe2ffd03f136dbecd408c73e4bc250ae249a4180 /instrumentation/afl-llvm-dict2file.so.cc
parent815161827689c339d335233b7b232ac9b120b79b (diff)
downloadafl++-32a0d6ac31554a47dca591f8978982758fb87677.tar.gz
Revert "Merge branch 'release' into stable"
This reverts commit 815161827689c339d335233b7b232ac9b120b79b, reversing
changes made to 9321a24e682b5c8bf6278961bd014cb883b87295.
Diffstat (limited to 'instrumentation/afl-llvm-dict2file.so.cc')
-rw-r--r--instrumentation/afl-llvm-dict2file.so.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/instrumentation/afl-llvm-dict2file.so.cc b/instrumentation/afl-llvm-dict2file.so.cc
index 58f01920..9daa75a8 100644
--- a/instrumentation/afl-llvm-dict2file.so.cc
+++ b/instrumentation/afl-llvm-dict2file.so.cc
@@ -541,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);