about summary refs log tree commit diff
path: root/src/afl-fuzz.c
diff options
context:
space:
mode:
authorfuzzah <fuzzah@tuta.io>2021-03-17 01:51:40 +0300
committerfuzzah <fuzzah@tuta.io>2021-03-20 01:32:28 +0300
commitd7e121e2c99c02d4b6984f21ba837d44bce9c77c (patch)
tree2263044f6ce1e845226245b0ba7381ab99490976 /src/afl-fuzz.c
parent65b90001f6e731f22178cb592b9812639bff4cb5 (diff)
downloadafl++-d7e121e2c99c02d4b6984f21ba837d44bce9c77c.tar.gz
add AFL_TARGET_ENV to afl-fuzz
Diffstat (limited to 'src/afl-fuzz.c')
-rw-r--r--src/afl-fuzz.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index cfb507a7..9ea1fb34 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -223,6 +223,7 @@ static void usage(u8 *argv0, int more_help) {
       "AFL_PYTHON_MODULE: mutate and trim inputs with the specified Python module\n"
       "AFL_QUIET: suppress forkserver status messages\n"
       "AFL_PRELOAD: LD_PRELOAD / DYLD_INSERT_LIBRARIES settings for target\n"
+      "AFL_TARGET_ENV: pass extra environment variables to target\n"
       "AFL_SHUFFLE_QUEUE: reorder the input queue randomly on startup\n"
       "AFL_SKIP_BIN_CHECK: skip the check, if the target is an executable\n"
       "AFL_SKIP_CPUFREQ: do not warn about variable cpu clocking\n"
@@ -1303,6 +1304,13 @@ int main(int argc, char **argv_orig, char **envp) {
 
   }
 
+  u8 *extra_env = (u8 *)getenv("AFL_TARGET_ENV");
+  if (extra_env && !extract_and_set_env(extra_env)) {
+
+    FATAL("Bad value of AFL_TARGET_ENV");
+
+  }
+
   save_cmdline(afl, argc, argv);
 
   fix_up_banner(afl, argv[optind]);