aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-11-23 19:37:27 +0100
committervanhauser-thc <vh@thc.org>2021-11-23 19:37:27 +0100
commit90d7931af6398cf632b5bf2371e3cb6c35286e70 (patch)
tree86bf6a81f2a5fb057344b2f30ad150d9da46f8fd
parent11f89ab785f0b74c0862c46406f81007ac5cf3ba (diff)
downloadafl++-90d7931af6398cf632b5bf2371e3cb6c35286e70.tar.gz
fixes
-rw-r--r--instrumentation/SanitizerCoverageLTO.so.cc4
-rw-r--r--instrumentation/afl-llvm-dict2file.so.cc4
2 files changed, 2 insertions, 6 deletions
diff --git a/instrumentation/SanitizerCoverageLTO.so.cc b/instrumentation/SanitizerCoverageLTO.so.cc
index dbe4672c..7710e262 100644
--- a/instrumentation/SanitizerCoverageLTO.so.cc
+++ b/instrumentation/SanitizerCoverageLTO.so.cc
@@ -621,7 +621,6 @@ bool ModuleSanitizerCoverage::instrumentModule(
bool isStrncasecmp = true;
bool isIntMemcpy = true;
bool isStdString = true;
- bool addedNull = false;
size_t optLen = 0;
Function *Callee = callInst->getCalledFunction();
@@ -801,7 +800,6 @@ bool ModuleSanitizerCoverage::instrumentModule(
if (literalLength + 1 == optLength) {
Str2.append("\0", 1); // add null byte
- // addedNull = true;
}
@@ -909,8 +907,8 @@ bool ModuleSanitizerCoverage::instrumentModule(
if (optLen < 2) { continue; }
if (literalLength + 1 == optLen) { // add null byte
+
thestring.append("\0", 1);
- addedNull = true;
}
diff --git a/instrumentation/afl-llvm-dict2file.so.cc b/instrumentation/afl-llvm-dict2file.so.cc
index d4f36b2c..2ffa8fbb 100644
--- a/instrumentation/afl-llvm-dict2file.so.cc
+++ b/instrumentation/afl-llvm-dict2file.so.cc
@@ -291,7 +291,6 @@ bool AFLdict2filePass::runOnModule(Module &M) {
bool isIntMemcpy = true;
bool isStdString = true;
bool isStrstr = true;
- bool addedNull = false;
size_t optLen = 0;
Function *Callee = callInst->getCalledFunction();
@@ -591,7 +590,6 @@ bool AFLdict2filePass::runOnModule(Module &M) {
if (optLen < 2) { continue; }
if (literalLength + 1 == optLen) { // add null byte
thestring.append("\0", 1);
- addedNull = true;
}
@@ -618,7 +616,7 @@ bool AFLdict2filePass::runOnModule(Module &M) {
// ensure we do not have garbage
size_t offset = thestring.find('\0', 0);
- if (offset && offset < opLen && offset + 1 < optLen) {
+ if (offset && offset < optLen && offset + 1 < optLen) {
optLen = offset + 1;