about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-02-17 17:40:01 +0100
committervanhauser-thc <vh@thc.org>2021-02-17 17:40:01 +0100
commit4c47b242eb976b8518ab8884733d02465f02d90a (patch)
tree1a4d19a2246bbd75d861c6b91e04ca9b2178fa60
parent938512a6b9451000f40491b2554b5d360840cfe5 (diff)
downloadafl++-4c47b242eb976b8518ab8884733d02465f02d90a.tar.gz
fix FPE in colorization
-rw-r--r--src/afl-fuzz-redqueen.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/afl-fuzz-redqueen.c b/src/afl-fuzz-redqueen.c
index 275af9c8..bbe35fe5 100644
--- a/src/afl-fuzz-redqueen.c
+++ b/src/afl-fuzz-redqueen.c
@@ -421,8 +421,9 @@ static u8 colorization(afl_state_t *afl, u8 *buf, u32 len,
 
   if (taint) {
 
-    if (len / positions == 1 && positions > CMPLOG_POSITIONS_MAX &&
-        afl->active_paths / afl->colorize_success > CMPLOG_CORPUS_PERCENT) {
+    if (afl->colorize_success &&
+        (len / positions == 1 && positions > CMPLOG_POSITIONS_MAX &&
+         afl->active_paths / afl->colorize_success > CMPLOG_CORPUS_PERCENT)) {
 
 #ifdef _DEBUG
       fprintf(stderr, "Colorization unsatisfactory\n");
@@ -1547,6 +1548,7 @@ static u8 cmp_fuzz(afl_state_t *afl, u32 key, u8 *orig_buf, u8 *buf, u8 *cbuf,
       is_n = 1;
 
   }
+
 #endif
 
   for (i = 0; i < loggeds; ++i) {