fix aflfast

This commit is contained in:
vanhauser-thc
2021-07-15 16:20:55 +02:00
parent b5422c1a52
commit 6e704e8a10

View File

@ -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. */