migrated autoresume to use get_afl_env
MODIFY
include/afl-fuzz.h
include/afl-fuzz.h
@@ -315,6 +315,7 @@ extern u8 skip_deterministic, /* Skip deterministic stages? */
no_forkserver, /* Disable forkserver? */
crash_mode, /* Crash mode! Yeah! */
in_place_resume, /* Attempt in-place resume? */
+ autoresume, /* Resume if out_dir exists? */
auto_changed, /* Auto-generated tokens changed? */
no_cpu_meter_red, /* Feng shui on the status screen */
no_arith, /* Skip most arithmetic ops */

MODIFY
src/afl-fuzz-globals.c
src/afl-fuzz-globals.c
@@ -115,6 +115,7 @@ u8 skip_deterministic, /* Skip deterministic stages? */
no_forkserver, /* Disable forkserver? */
crash_mode, /* Crash mode! Yeah! */
in_place_resume, /* Attempt in-place resume? */
+ autoresume, /* Resume if out_dir exists? */
auto_changed, /* Auto-generated tokens changed? */
no_cpu_meter_red, /* Feng shui on the status screen */
no_arith, /* Skip most arithmetic ops */

MODIFY
src/afl-fuzz-init.c
src/afl-fuzz-init.c
@@ -1066,7 +1066,7 @@ static void handle_existing_out_dir(void) {
/* Autoresume treats a normal run as in_place_resume if a valid out dir already exists */
- if (getenv("AFL_AUTORESUME")) {
+ if (!in_place_resume && autoresume) {
OKF("Detected prior run with AFL_AUTORESUME set. Resuming.");
in_place_resume = 1;

MODIFY
src/afl-fuzz.c
src/afl-fuzz.c
@@ -314,14 +314,7 @@ int main(int argc, char** argv, char** envp) {
if (in_dir) FATAL("Multiple -i options not supported");
in_dir = optarg;
- if (!strcmp(in_dir, "-")) {
-
- if (getenv("AFL_AUTORESUME"))
- WARNF("AFL_AUTORESUME has no effect for '-i -'");
-
- in_place_resume = 1;
-
- }
+ if (!strcmp(in_dir, "-")) in_place_resume = 1;
break;
@@ -757,6 +750,14 @@ int main(int argc, char** argv, char** envp) {
if (get_afl_env("AFL_SHUFFLE_QUEUE")) shuffle_queue = 1;
if (get_afl_env("AFL_FAST_CAL")) fast_cal = 1;
+ if (get_afl_env("AFL_AUTORESUME")) {
+
+ autoresume = 1;
+ if (in_place_resume)
+ WARNF("AFL_AUTORESUME has no effect for '-i -'");
+
+ }
+
if (get_afl_env("AFL_HANG_TMOUT")) {
hang_tmout = atoi(getenv("AFL_HANG_TMOUT"));

migrated autoresume to use get_afl_env