From 126d1f1cd14c6bb1fb59159965045f02d98d1b43 Mon Sep 17 00:00:00 2001 From: Rishi Ranjan <43873720+rish9101@users.noreply.github.com> Date: Sun, 15 Mar 2020 22:59:23 +0530 Subject: Move afl-fuzz related env variables into afl_state_t (#252) * Move afl-fuzz related env variables into afl_state_t * Move the env variables assignment from fuzz_init and code Format * Fix typo * Remove redundant env variables from afl_env struct * Rename function to read_afl_environment --- src/afl-fuzz-stats.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/afl-fuzz-stats.c') diff --git a/src/afl-fuzz-stats.c b/src/afl-fuzz-stats.c index e03018a1..0885c906 100644 --- a/src/afl-fuzz-stats.c +++ b/src/afl-fuzz-stats.c @@ -274,10 +274,10 @@ void show_stats(afl_state_t *afl) { /* Honor AFL_EXIT_WHEN_DONE and AFL_BENCH_UNTIL_CRASH. */ if (!afl->dumb_mode && afl->cycles_wo_finds > 100 && - !afl->pending_not_fuzzed && get_afl_env("AFL_EXIT_WHEN_DONE")) + !afl->pending_not_fuzzed && afl->afl_env.afl_exit_when_done) afl->stop_soon = 2; - if (afl->total_crashes && get_afl_env("AFL_BENCH_UNTIL_CRASH")) + if (afl->total_crashes && afl->afl_env.afl_bench_until_crash) afl->stop_soon = 2; /* If we're not on TTY, bail out. */ @@ -860,7 +860,7 @@ void show_init_stats(afl_state_t *afl) { /* In dumb mode, re-running every timing out test case with a generous time limit is very expensive, so let's select a more conservative default. */ - if (afl->dumb_mode && !get_afl_env("AFL_HANG_TMOUT")) + if (afl->dumb_mode && !(afl->afl_env.afl_hang_tmout)) afl->hang_tmout = MIN(EXEC_TIMEOUT, afl->fsrv.exec_tmout * 2 + 100); OKF("All set and ready to roll!"); -- cgit 1.4.1