aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2020-10-28 14:32:53 +0100
committerAndrea Fioraldi <andreafioraldi@gmail.com>2020-10-28 14:32:53 +0100
commitfe705bb9567341427ce1ea39d5fc6b19fdee1646 (patch)
treeee4c73bb4d493fca7f0e8b25723f5c60ed4070e0 /src
parent5ee63a6e6267e448342ccb28cc8d3c0d34ffc1cd (diff)
downloadafl++-fe705bb9567341427ce1ea39d5fc6b19fdee1646.tar.gz
expand havoc if not new findings in the last 5 seconds
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-one.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/afl-fuzz-one.c b/src/afl-fuzz-one.c
index bf568c38..2e186b90 100644
--- a/src/afl-fuzz-one.c
+++ b/src/afl-fuzz-one.c
@@ -1884,16 +1884,22 @@ havoc_stage:
u32 r_max, r;
+ r_max = 15 + ((afl->extras_cnt + afl->a_extras_cnt) ? 2 : 0);
+
if (unlikely(afl->expand_havoc)) {
/* add expensive havoc cases here, they are activated after a full
cycle without finds happened */
- r_max = 16 + ((afl->extras_cnt + afl->a_extras_cnt) ? 2 : 0);
+ r_max += 1;
- } else {
+ }
+
+ if (unlikely(get_cur_time() - afl->last_path_time > 5000)) {
+
+ /* add expensive havoc cases here if there is no findings in the last 5s */
- r_max = 15 + ((afl->extras_cnt + afl->a_extras_cnt) ? 2 : 0);
+ r_max += 1;
}