about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-02-22 12:34:37 +0100
committervanhauser-thc <vh@thc.org>2021-02-22 12:34:37 +0100
commit2785c8b197a1e7f109fa4dfb47fdd82eca0ad008 (patch)
tree423fa64995b1310040545c8e2319179b2dcc7cd9
parenta81b5aa921567ba92c22c9ab1c4493725c43e8aa (diff)
downloadafl++-2785c8b197a1e7f109fa4dfb47fdd82eca0ad008.tar.gz
crash fix
-rw-r--r--src/afl-fuzz-init.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c
index 702e732d..e372c803 100644
--- a/src/afl-fuzz-init.c
+++ b/src/afl-fuzz-init.c
@@ -1060,13 +1060,22 @@ void perform_dry_run(afl_state_t *afl) {
         p->perf_score = 0;
 
         u32 i = 0;
-        while (unlikely(afl->queue_buf[i]->disabled)) {
+        while (unlikely(i < afl->queued_paths && afl->queue_buf[i] &&
+                        afl->queue_buf[i]->disabled)) {
 
           ++i;
 
         }
 
-        afl->queue = afl->queue_buf[i];
+        if (i < afl->queued_paths && afl->queue_buf[i]) {
+
+          afl->queue = afl->queue_buf[i];
+
+        } else {
+
+          afl->queue = afl->queue_buf[0];
+
+        }
 
         afl->max_depth = 0;
         for (i = 0; i < afl->queued_paths; i++) {