diff options
author | van Hauser <vh@thc.org> | 2020-06-25 22:44:46 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-06-25 22:44:46 +0200 |
commit | 8bd8442bcc5a57a6ce5461e26cd957b343a12fc2 (patch) | |
tree | 72382026ce5fd5bd772ebc26e7d701092f5c395c /src | |
parent | 590408323137b97807370929e56fba9790c2c51c (diff) | |
download | afl++-8bd8442bcc5a57a6ce5461e26cd957b343a12fc2.tar.gz |
fix for schedules
Diffstat (limited to 'src')
-rw-r--r-- | src/afl-fuzz-bitmap.c | 2 | ||||
-rw-r--r-- | src/afl-fuzz-queue.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/afl-fuzz-bitmap.c b/src/afl-fuzz-bitmap.c index f643b5c0..aa8d5a18 100644 --- a/src/afl-fuzz-bitmap.c +++ b/src/afl-fuzz-bitmap.c @@ -559,7 +559,7 @@ u8 save_if_interesting(afl_state_t *afl, void *mem, u32 len, u8 fault) { if (q->exec_cksum == cksum) { - q->n_fuzz = q->n_fuzz + 1; + ++q->n_fuzz; break; } diff --git a/src/afl-fuzz-queue.c b/src/afl-fuzz-queue.c index 4c6eb88f..7afdd9f1 100644 --- a/src/afl-fuzz-queue.c +++ b/src/afl-fuzz-queue.c @@ -196,7 +196,7 @@ void update_bitmap_score(afl_state_t *afl, struct queue_entry *q) { u64 fav_factor; u64 fuzz_p2; - if (unlikely(afl->schedule >= FAST)) + if (unlikely(afl->schedule >= FAST && afl->schedule <= RARE)) fuzz_p2 = next_pow2(q->n_fuzz); else fuzz_p2 = q->fuzz_level; @@ -222,7 +222,7 @@ void update_bitmap_score(afl_state_t *afl, struct queue_entry *q) { /* Faster-executing or smaller test cases are favored. */ u64 top_rated_fav_factor; u64 top_rated_fuzz_p2; - if (unlikely(afl->schedule >= FAST)) + if (unlikely(afl->schedule >= FAST && afl->schedule <= RARE)) top_rated_fuzz_p2 = next_pow2(afl->top_rated[i]->n_fuzz); else top_rated_fuzz_p2 = afl->top_rated[i]->fuzz_level; @@ -601,7 +601,7 @@ u32 calculate_score(afl_state_t *afl, struct queue_entry *q) { } - if (unlikely(afl->schedule >= FAST)) { + if (unlikely(afl->schedule >= FAST && afl->schedule <= RARE)) { if (factor > MAX_FACTOR) { factor = MAX_FACTOR; } perf_score *= factor / POWER_BETA; |