about summary refs log tree commit diff
path: root/src/afl-showmap.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-01-21 19:58:25 +0100
committervan Hauser <vh@thc.org>2021-01-21 19:58:25 +0100
commit30148bc1a9938cc29047d198eab72818cd037e3c (patch)
treef2b62b33fb5aa15b7fe0a5f9e7483533365f6340 /src/afl-showmap.c
parent60764ebdf15be0affdd3040135fc6eb36e10d677 (diff)
downloadafl++-30148bc1a9938cc29047d198eab72818cd037e3c.tar.gz
fix afl-showmap and gcc plugin test
Diffstat (limited to 'src/afl-showmap.c')
-rw-r--r--src/afl-showmap.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index ee6d6de9..ab47c602 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -85,6 +85,7 @@ static u8 quiet_mode,                  /* Hide non-essential messages?      */
     keep_cores,                        /* Allow coredumps?                  */
     remove_shm = 1,                    /* remove shmem?                     */
     collect_coverage,                  /* collect coverage                  */
+    have_coverage,                     /* have coverage?                    */
     no_classify;                       /* do not classify counts            */
 
 static volatile u8 stop_soon,          /* Ctrl-C pressed?                   */
@@ -316,7 +317,8 @@ static void showmap_run_target_forkserver(afl_forkserver_t *fsrv, u8 *mem,
 
   }
 
-  if (fsrv->trace_bits[0] == 1) { fsrv->trace_bits[0] = 0; }
+  if (fsrv->trace_bits[0] == 1) { fsrv->trace_bits[0] = 0; have_coverage = 1; }
+  else { have_coverage = 0; }
 
   if (!no_classify) { classify_counts(fsrv); }
 
@@ -491,7 +493,8 @@ static void showmap_run_target(afl_forkserver_t *fsrv, char **argv) {
 
   }
 
-  if (fsrv->trace_bits[0] == 1) { fsrv->trace_bits[0] = 0; }
+  if (fsrv->trace_bits[0] == 1) { fsrv->trace_bits[0] = 0; have_coverage = 1; }
+  else { have_coverage = 0; }
 
   if (!no_classify) { classify_counts(fsrv); }
 
@@ -1232,7 +1235,7 @@ int main(int argc, char **argv_orig, char **envp) {
 
   if (!quiet_mode || collect_coverage) {
 
-    if (!tcnt) { FATAL("No instrumentation detected" cRST); }
+    if (!tcnt && !have_coverage) { FATAL("No instrumentation detected" cRST); }
     OKF("Captured %u tuples (highest value %u, total values %llu) in "
         "'%s'." cRST,
         tcnt, highest, total, out_file);