diff options
author | vanhauser-thc <vh@thc.org> | 2021-07-15 16:20:55 +0200 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2021-07-15 16:20:55 +0200 |
commit | 6e704e8a10d0e0033b0f8f03ee2a5bdee06e2c65 (patch) | |
tree | b78600fd8311099aa6233ec16c9597fc5fd23280 | |
parent | b5422c1a5251e74deeecc1532d50c651620bb1ca (diff) | |
download | afl++-6e704e8a10d0e0033b0f8f03ee2a5bdee06e2c65.tar.gz |
fix aflfast
-rw-r--r-- | src/afl-fuzz-bitmap.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/afl-fuzz-bitmap.c b/src/afl-fuzz-bitmap.c index 97f10e6f..0a9242a5 100644 --- a/src/afl-fuzz-bitmap.c +++ b/src/afl-fuzz-bitmap.c @@ -551,19 +551,18 @@ save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) { } - if (cksum) - afl->queue_top->exec_cksum = cksum; - else - cksum = afl->queue_top->exec_cksum = - hash64(afl->fsrv.trace_bits, afl->fsrv.map_size, HASH_CONST); - - if (afl->schedule >= FAST && afl->schedule <= RARE) { + /* AFLFast schedule? update the new queue entry */ + if (cksum) { afl->queue_top->n_fuzz_entry = cksum % N_FUZZ_SIZE; afl->n_fuzz[afl->queue_top->n_fuzz_entry] = 1; } + /* due to classify counts we have to recalculate the checksum */ + cksum = afl->queue_top->exec_cksum = + hash64(afl->fsrv.trace_bits, afl->fsrv.map_size, HASH_CONST); + /* Try to calibrate inline; this also calls update_bitmap_score() when successful. */ |