Fix exit_on_time (#1555)

This commit is contained in:
Kobrin Eli
2022-10-15 13:06:11 +03:00
committed by GitHub
parent 77ebab64d3
commit 26d4771678

View File

@ -1410,12 +1410,13 @@ void show_stats_pizza(afl_state_t *afl) {
/* AFL_EXIT_ON_TIME. */ /* AFL_EXIT_ON_TIME. */
if (unlikely(afl->last_find_time && !afl->non_instrumented_mode && /* If no coverage was found yet, check whether run time is greater than exit_on_time. */
afl->afl_env.afl_exit_on_time &&
(cur_ms - afl->last_find_time) > afl->exit_on_time)) {
if (unlikely(!afl->non_instrumented_mode && afl->afl_env.afl_exit_on_time &&
(afl->last_find_time && (cur_ms - afl->last_find_time) > afl->exit_on_time ||
!afl->last_find_time &&
(afl->prev_run_time + cur_ms - afl->start_time) > afl->exit_on_time))) {
afl->stop_soon = 2; afl->stop_soon = 2;
} }
if (unlikely(afl->total_crashes && afl->afl_env.afl_bench_until_crash)) { if (unlikely(afl->total_crashes && afl->afl_env.afl_bench_until_crash)) {