This commit is contained in:
vanhauser-thc
2021-11-23 19:37:27 +01:00
parent 11f89ab785
commit 90d7931af6
2 changed files with 2 additions and 6 deletions

View File

@ -621,7 +621,6 @@ bool ModuleSanitizerCoverage::instrumentModule(
bool isStrncasecmp = true; bool isStrncasecmp = true;
bool isIntMemcpy = true; bool isIntMemcpy = true;
bool isStdString = true; bool isStdString = true;
bool addedNull = false;
size_t optLen = 0; size_t optLen = 0;
Function *Callee = callInst->getCalledFunction(); Function *Callee = callInst->getCalledFunction();
@ -801,7 +800,6 @@ bool ModuleSanitizerCoverage::instrumentModule(
if (literalLength + 1 == optLength) { if (literalLength + 1 == optLength) {
Str2.append("\0", 1); // add null byte Str2.append("\0", 1); // add null byte
// addedNull = true;
} }
@ -909,8 +907,8 @@ bool ModuleSanitizerCoverage::instrumentModule(
if (optLen < 2) { continue; } if (optLen < 2) { continue; }
if (literalLength + 1 == optLen) { // add null byte if (literalLength + 1 == optLen) { // add null byte
thestring.append("\0", 1); thestring.append("\0", 1);
addedNull = true;
} }

View File

@ -291,7 +291,6 @@ bool AFLdict2filePass::runOnModule(Module &M) {
bool isIntMemcpy = true; bool isIntMemcpy = true;
bool isStdString = true; bool isStdString = true;
bool isStrstr = true; bool isStrstr = true;
bool addedNull = false;
size_t optLen = 0; size_t optLen = 0;
Function *Callee = callInst->getCalledFunction(); Function *Callee = callInst->getCalledFunction();
@ -591,7 +590,6 @@ bool AFLdict2filePass::runOnModule(Module &M) {
if (optLen < 2) { continue; } if (optLen < 2) { continue; }
if (literalLength + 1 == optLen) { // add null byte if (literalLength + 1 == optLen) { // add null byte
thestring.append("\0", 1); thestring.append("\0", 1);
addedNull = true;
} }
@ -618,7 +616,7 @@ bool AFLdict2filePass::runOnModule(Module &M) {
// ensure we do not have garbage // ensure we do not have garbage
size_t offset = thestring.find('\0', 0); size_t offset = thestring.find('\0', 0);
if (offset && offset < opLen && offset + 1 < optLen) { if (offset && offset < optLen && offset + 1 < optLen) {
optLen = offset + 1; optLen = offset + 1;