diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/afl-fuzz-state.c | 9 | ||||
-rw-r--r-- | src/afl-fuzz-stats.c | 2 | ||||
-rw-r--r-- | src/afl-fuzz.c | 13 |
3 files changed, 19 insertions, 5 deletions
diff --git a/src/afl-fuzz-state.c b/src/afl-fuzz-state.c index 507ddb46..5924dd7b 100644 --- a/src/afl-fuzz-state.c +++ b/src/afl-fuzz-state.c @@ -502,6 +502,15 @@ void read_afl_environment(afl_state_t *afl, char **envp) { afl->afl_env.afl_pizza_mode = atoi((u8 *)get_afl_env(afl_environment_variables[i])); + if (afl->afl_env.afl_pizza_mode == 0) { + + afl->afl_env.afl_pizza_mode = 1; + + } else { + + afl->pizza_is_served = 1; + + } } diff --git a/src/afl-fuzz-stats.c b/src/afl-fuzz-stats.c index 80c22c34..9737c692 100644 --- a/src/afl-fuzz-stats.c +++ b/src/afl-fuzz-stats.c @@ -437,7 +437,7 @@ static void check_term_size(afl_state_t *afl) { void show_stats(afl_state_t *afl) { - if (afl->afl_env.afl_pizza_mode) { + if (afl->pizza_is_served) { show_stats_pizza(afl); diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c index 5c5ce0fb..92243fbb 100644 --- a/src/afl-fuzz.c +++ b/src/afl-fuzz.c @@ -259,6 +259,7 @@ static void usage(u8 *argv0, int more_help) { "AFL_IGNORE_PROBLEMS: do not abort fuzzing if an incorrect setup is detected during a run\n" "AFL_IMPORT_FIRST: sync and import test cases from other fuzzer instances first\n" "AFL_INPUT_LEN_MIN/AFL_INPUT_LEN_MAX: like -g/-G set min/max fuzz length produced\n" + "AFL_PIZZA_MODE: 1 - enforce pizza mode, 0 - disable for April 1st\n" "AFL_KILL_SIGNAL: Signal ID delivered to child processes on timeout, etc. (default: SIGKILL)\n" "AFL_MAP_SIZE: the shared memory size for that target. must be >= the size\n" " the target was compiled for\n" @@ -2274,13 +2275,17 @@ int main(int argc, char **argv_orig, char **envp) { // queue is fully cycled. time_t cursec = time(NULL); struct tm *curdate = localtime(&cursec); - if (curdate->tm_mon == 3 && curdate->tm_mday == 1) { + if (likely(!afl->afl_env.afl_pizza_mode)) { - afl->afl_env.afl_pizza_mode = 1; + if (unlikely(curdate->tm_mon == 3 && curdate->tm_mday == 1)) { - } else { + afl->pizza_is_served = 1; + + } else { - afl->afl_env.afl_pizza_mode = 0; + afl->pizza_is_served = 0; + + } } |