diff options
author | llzmb <46303940+llzmb@users.noreply.github.com> | 2021-11-30 20:28:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 20:28:20 +0100 |
commit | da13111117efdb70f81deb162bd9e64c9a7d778a (patch) | |
tree | 2d9dbe7aac1212e5729a0a744a5b37e957d0d8a0 /instrumentation/SanitizerCoverageLTO.so.cc | |
parent | f2ff029cc25e81fec36abd0b8c676f1dd6a39c77 (diff) | |
parent | 5525f8c9ef8bb879dadd0eb942d524827d1b0362 (diff) | |
download | afl++-da13111117efdb70f81deb162bd9e64c9a7d778a.tar.gz |
Merge branch 'dev' into docs_edit_readme_frida_mode_qemu_mode
Diffstat (limited to 'instrumentation/SanitizerCoverageLTO.so.cc')
-rw-r--r-- | instrumentation/SanitizerCoverageLTO.so.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/instrumentation/SanitizerCoverageLTO.so.cc b/instrumentation/SanitizerCoverageLTO.so.cc index 4e25221a..37726607 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; } @@ -922,14 +920,18 @@ bool ModuleSanitizerCoverage::instrumentModule( // was not already added if (!isMemcmp) { - if (addedNull == false && thestring[optLen - 1] != '\0') { + /* + if (addedNull == false && thestring[optLen - 1] != + '\0') { - thestring.append("\0", 1); // add null byte - optLen++; + thestring.append("\0", 1); // add null byte + optLen++; - } + } - if (!isStdString) { + */ + if (!isStdString && + thestring.find('\0', 0) != std::string::npos) { // ensure we do not have garbage size_t offset = thestring.find('\0', 0); |