about summary refs log tree commit diff
path: root/src/afl-fuzz-init.c
diff options
context:
space:
mode:
authorDominik Maier <domenukk@gmail.com>2021-05-15 17:33:05 +0200
committerDominik Maier <domenukk@gmail.com>2021-05-15 17:33:05 +0200
commit000c72909530274cb52015fee69e9700ec6a2c7e (patch)
tree8ad03b0c701e2200bac669ee209404a7032858cf /src/afl-fuzz-init.c
parent72ca9b4684981ce2b807e4efd218bd1924f3e6b1 (diff)
downloadafl++-000c72909530274cb52015fee69e9700ec6a2c7e.tar.gz
added bounds check to pivot_inputs (fixes #921)
Diffstat (limited to 'src/afl-fuzz-init.c')
-rw-r--r--src/afl-fuzz-init.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/afl-fuzz-init.c b/src/afl-fuzz-init.c
index cb586111..7337bfbf 100644
--- a/src/afl-fuzz-init.c
+++ b/src/afl-fuzz-init.c
@@ -1294,9 +1294,13 @@ void pivot_inputs(afl_state_t *afl) {
 
       if (src_str && sscanf(src_str + 1, "%06u", &src_id) == 1) {
 
-        struct queue_entry *s = afl->queue_buf[src_id];
+        if (src_id < afl->queued_paths) {
 
-        if (s) { q->depth = s->depth + 1; }
+          struct queue_entry *s = afl->queue_buf[src_id];
+
+          if (s) { q->depth = s->depth + 1; }
+
+        }
 
         if (afl->max_depth < q->depth) { afl->max_depth = q->depth; }