about summary refs log tree commit diff
path: root/src/afl-fuzz-state.c
diff options
context:
space:
mode:
authorAmit Elkabetz <12958411+amitelka@users.noreply.github.com>2023-03-05 20:25:39 +0200
committerAmit Elkabetz <12958411+amitelka@users.noreply.github.com>2023-03-05 20:25:39 +0200
commite9e440d7f33a61793c63f90f9555ff3c0f45b3b4 (patch)
tree4b59d4b073d416167358f5dcfb579a75eac181b1 /src/afl-fuzz-state.c
parent5e7f8a51e0f45780d9c8ff34ace6b03f8a7e1f71 (diff)
downloadafl++-e9e440d7f33a61793c63f90f9555ff3c0f45b3b4.tar.gz
Fixed according to PR comment, moved cli flag to an env variable
Diffstat (limited to 'src/afl-fuzz-state.c')
-rw-r--r--src/afl-fuzz-state.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/afl-fuzz-state.c b/src/afl-fuzz-state.c
index e319c512..8964f38e 100644
--- a/src/afl-fuzz-state.c
+++ b/src/afl-fuzz-state.c
@@ -24,6 +24,7 @@
  */
 
 #include <signal.h>
+#include <limits.h>
 #include "afl-fuzz.h"
 #include "envs.h"
 
@@ -566,6 +567,25 @@ void read_afl_environment(afl_state_t *afl, char **envp) {
 
             }
 
+          } else if (!strncmp(env, "AFL_FUZZER_STATS_UPDATE_INTERVAL",
+
+                              afl_environment_variable_len)) {
+
+            u64 stats_update_freq_sec =
+                strtoull(get_afl_env(afl_environment_variables[i]), NULL, 0);
+            if (ULLONG_MAX == stats_update_freq_sec ||
+                0 == stats_update_freq_sec) {
+
+              WARNF(
+                  "Incorrect value given to AFL_FUZZER_STATS_UPDATE_INTERVAL, "
+                  "using default of 60 seconds\n");
+
+            } else {
+
+              afl->stats_file_update_freq_msecs = stats_update_freq_sec * 1000;
+
+            }
+
           }
 
         } else {