added bounds check to pivot_inputs (fixes #921)

This commit is contained in:
Dominik Maier
2021-05-15 17:33:05 +02:00
parent 72ca9b4684
commit 000c729095

View File

@ -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; }