Added minimum interval of 1 sec to avoid undefined behaviour in interval

This commit is contained in:
Amit Elkabetz
2023-03-05 18:27:07 +02:00
parent 403d95d2d2
commit 5e7f8a51e0

View File

@ -212,7 +212,7 @@ static void usage(u8 *argv0, int more_help) {
" -e ext - file extension for the fuzz test input file (if "
"needed)\n"
" -u - interval to update fuzzer_stats file in seconds, "
"defaults to 60 sec\n"
"defaults to 60 sec, minimum interval: 1 sec\n"
"\n",
argv0, EXEC_TIMEOUT, MEM_LIMIT, MAX_FILE, FOREIGN_SYNCS_MAX);
@ -673,6 +673,8 @@ int main(int argc, char **argv_orig, char **envp) {
}
if (stats_update_freq_sec < 1) { FATAL("-u interval must be >= 1"); }
afl->stats_file_update_freq_msecs = stats_update_freq_sec * 1000;
break;