about summary refs log tree commit diff
path: root/src/afl-fuzz-stats.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-10-24 20:46:31 +0200
committerGitHub <noreply@github.com>2022-10-24 20:46:31 +0200
commita075cddef6ae71516a960116f3d944efd5671e5d (patch)
tree724dd6978ebb10f52c4bdda86eb44a5494b33409 /src/afl-fuzz-stats.c
parentd1e1bbc713b22d620956143634ecdf97223aa59f (diff)
parent05e0825d66d938308842c25c4c74b5cdd4a885eb (diff)
downloadafl++-a075cddef6ae71516a960116f3d944efd5671e5d.tar.gz
Merge pull request #1561 from AFLplusplus/dev
push to stable
Diffstat (limited to 'src/afl-fuzz-stats.c')
-rw-r--r--src/afl-fuzz-stats.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/afl-fuzz-stats.c b/src/afl-fuzz-stats.c
index 713f3a3c..61956dc3 100644
--- a/src/afl-fuzz-stats.c
+++ b/src/afl-fuzz-stats.c
@@ -1410,9 +1410,15 @@ void show_stats_pizza(afl_state_t *afl) {
 
   /* AFL_EXIT_ON_TIME. */
 
-  if (unlikely(afl->last_find_time && !afl->non_instrumented_mode &&
-               afl->afl_env.afl_exit_on_time &&
-               (cur_ms - afl->last_find_time) > afl->exit_on_time)) {
+  /* If no coverage was found yet, check whether run time is greater than
+   * 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;