diff options
author | Daniil Kuts <13482580+apach301@users.noreply.github.com> | 2022-05-27 13:52:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-27 12:52:31 +0200 |
commit | c96238d85f4a784402db6cbf16630b977617eb1a (patch) | |
tree | 426799e929930c90ce2619b1aaa9944c6d400502 /src/afl-fuzz-state.c | |
parent | 4103ee43e249ee14bd16baf080489a107bbfdbf5 (diff) | |
download | afl++-c96238d85f4a784402db6cbf16630b977617eb1a.tar.gz |
Add AFL_SYNC_TIME variable for synchronization time tuning (#1425)
* Add AFL_SYNC_TIME variable for synchronization time tuning * Documentation for AFL_SYNC_TIME variable
Diffstat (limited to 'src/afl-fuzz-state.c')
-rw-r--r-- | src/afl-fuzz-state.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/afl-fuzz-state.c b/src/afl-fuzz-state.c index 98217438..cbe32c75 100644 --- a/src/afl-fuzz-state.c +++ b/src/afl-fuzz-state.c @@ -101,6 +101,7 @@ void afl_state_init(afl_state_t *afl, uint32_t map_size) { afl->stats_update_freq = 1; afl->stats_avg_exec = 0; afl->skip_deterministic = 1; + afl->sync_time = SYNC_TIME; afl->cmplog_lvl = 2; afl->min_length = 1; afl->max_length = MAX_FILE; @@ -519,6 +520,17 @@ void read_afl_environment(afl_state_t *afl, char **envp) { } + } else if (!strncmp(env, "AFL_SYNC_TIME", + + afl_environment_variable_len)) { + + int time = atoi((u8 *)get_afl_env(afl_environment_variables[i])); + if (time > 0) { + afl->sync_time = time * (60 * 1000LL); + } else { + WARNF("incorrect value for AFL_SYNC_TIME environment variable, " + "used default value %lld instead.", afl->sync_time / 60 / 1000); + } } } else { |