about summary refs log tree commit diff
path: root/instrumentation/compare-transform-pass.so.cc
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-11-23 21:07:50 +0100
committervanhauser-thc <vh@thc.org>2021-11-23 21:08:28 +0100
commit8c4435e7ef6cad7a0d475603469e98c09d32f504 (patch)
treefc6e356855f23e4f8dc38a85170c0b6aa2346bb1 /instrumentation/compare-transform-pass.so.cc
parent1fbb7cb2fa0ad10c09f8515124989d119558121d (diff)
downloadafl++-8c4435e7ef6cad7a0d475603469e98c09d32f504.tar.gz
fix for llvm < 11
Diffstat (limited to 'instrumentation/compare-transform-pass.so.cc')
-rw-r--r--instrumentation/compare-transform-pass.so.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/instrumentation/compare-transform-pass.so.cc b/instrumentation/compare-transform-pass.so.cc
index 5db9c409..2eb3d77b 100644
--- a/instrumentation/compare-transform-pass.so.cc
+++ b/instrumentation/compare-transform-pass.so.cc
@@ -519,7 +519,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
     // in the unusual case the const str has embedded null
     // characters, the string comparison functions should terminate
     // at the first null
-    if (!isMemcmp) {
+    if (!isMemcmp && TmpConstStr.find('\0') != std::string::npos) {
 
       TmpConstStr.assign(TmpConstStr, 0, TmpConstStr.find('\0') + 1);