Fixed according to PR comment, moved cli flag to an env variable

This commit is contained in:
Amit Elkabetz
2023-03-05 20:25:39 +02:00
parent 5e7f8a51e0
commit e9e440d7f3
4 changed files with 35 additions and 18 deletions

View File

@ -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 {