From 5c35f3dbd125338b393ba0bcebfd0234c57719b7 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Thu, 13 Feb 2020 20:04:50 +0100 Subject: fix strncasecmp in tokencap --- libtokencap/libtokencap.so.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtokencap/libtokencap.so.c b/libtokencap/libtokencap.so.c index b6ef05f3..1bffd2fa 100644 --- a/libtokencap/libtokencap.so.c +++ b/libtokencap/libtokencap.so.c @@ -380,8 +380,8 @@ int strncasecmp(const char* str1, const char* str2, size_t len) { const unsigned char c1 = tolower(*str1), c2 = tolower(*str2); - if (!c1) return 0; if (c1 != c2) return (c1 > c2) ? 1 : -1; + if (!c1) return 0; str1++; str2++; -- cgit 1.4.1 From 12df4c4af7b7bf394fa92d40c6b3509da97d556d Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Thu, 13 Feb 2020 20:07:48 +0100 Subject: fix strncmp in tokencap --- libtokencap/libtokencap.so.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtokencap/libtokencap.so.c b/libtokencap/libtokencap.so.c index 1bffd2fa..d400d3b3 100644 --- a/libtokencap/libtokencap.so.c +++ b/libtokencap/libtokencap.so.c @@ -330,8 +330,8 @@ int strncmp(const char* str1, const char* str2, size_t len) { unsigned char c1 = *str1, c2 = *str2; - if (!c1) return 0; if (c1 != c2) return (c1 > c2) ? 1 : -1; + if (!c1) return 0; str1++; str2++; -- cgit 1.4.1 From 99b2adcbe20a3e823170cf5668bf949e98e7f8b1 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Thu, 13 Feb 2020 20:37:00 +0100 Subject: solve #194 --- llvm_mode/afl-llvm-pass.so.cc | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/llvm_mode/afl-llvm-pass.so.cc b/llvm_mode/afl-llvm-pass.so.cc index 2cd23adf..7d5cb224 100644 --- a/llvm_mode/afl-llvm-pass.so.cc +++ b/llvm_mode/afl-llvm-pass.so.cc @@ -467,14 +467,33 @@ bool AFLCoverage::runOnModule(Module &M) { if (!inst_blocks) WARNF("No instrumentation targets found."); - else - OKF("Instrumented %u locations (%s mode, ratio %u%%).", inst_blocks, - getenv("AFL_HARDEN") - ? "hardened" - : ((getenv("AFL_USE_ASAN") || getenv("AFL_USE_MSAN")) - ? "ASAN/MSAN" - : "non-hardened"), - inst_ratio); + else { + char mode[64]; + int not_hardened = 1; + if (getenv("AFL_HARDEN")) { + strcat(mode, "/hardened"); + not_hardened = 0; + } + if (getenv("AFL_USE_ASAN")) { + strcat(mode, "/ASAN"); + not_hardened = 0; + } + if (getenv("AFL_USE_MSAN")) { + strcat(mode, "/MSAN"); + not_hardened = 0; + } + if (getenv("AFL_USE_UBSAN")) { + strcat(mode, "/UNSAN"); + not_hardened = 0; + } + + if (not_hardened) + OKF("Instrumented %u locations (non-hardened mode, ratio %u%%).", + inst_blocks, inst_ratio); + else + OKF("Instrumented %u locations (%s mode, ratio %u%%).", inst_blocks, + &mode[1], inst_ratio); + } } -- cgit 1.4.1