about summary refs log tree commit diff
path: root/src/afl-fuzz.c
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2022-02-04 12:09:07 +0100
committervanhauser-thc <vh@thc.org>2022-02-04 12:09:07 +0100
commitd4c01c057bb8e6741e6652567f168e9bdd00f9cd (patch)
treeb95625dde2cda3abf4d13f371422ca25a8cd2074 /src/afl-fuzz.c
parent80543a809ec5a8f6bea45a5d20090a078daa6393 (diff)
downloadafl++-d4c01c057bb8e6741e6652567f168e9bdd00f9cd.tar.gz
test support for forced persistent mode
Diffstat (limited to 'src/afl-fuzz.c')
-rw-r--r--src/afl-fuzz.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index 9ef2669a..80059783 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -198,7 +198,7 @@ static void usage(u8 *argv0, int more_help) {
       "  -I command    - execute this command/script when a new crash is "
       "found\n"
       //"  -B bitmap.txt - mutate a specific test case, use the
-      //out/default/fuzz_bitmap file\n"
+      // out/default/fuzz_bitmap file\n"
       "  -C            - crash exploration mode (the peruvian rabbit thing)\n"
       "  -b cpu_id     - bind the fuzzing process to the specified CPU core "
       "(0-...)\n"
@@ -1897,6 +1897,17 @@ int main(int argc, char **argv_orig, char **envp) {
 
   check_binary(afl, argv[optind]);
 
+  if (getenv(PERSIST_ENV_VAR) && !afl->persistent_mode) {
+
+    WARNF(
+        "Persistent mode environment variable detected, forcing persitent "
+        "mode!");
+    afl->persistent_mode = 1;
+    afl->fsrv.persistent_mode = 1;
+    afl->shmem_testcase_mode = 1;
+
+  }
+
   #ifdef AFL_PERSISTENT_RECORD
   if (unlikely(afl->fsrv.persistent_record)) {