aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-05-21 13:04:17 +0200
committervanhauser-thc <vh@thc.org>2023-05-21 13:04:17 +0200
commit9a6c0ec0c0af42d33e4350ee2958b58fef1c39dd (patch)
tree37acba3de2e77ca4a2fa6be15f51c449031ca7f0
parent53a869b757287e8bebdfcbc96b8abe1729955171 (diff)
downloadAFLplusplus-9a6c0ec0c0af42d33e4350ee2958b58fef1c39dd.tar.gz
make AFL_CUSTOM_INFO overridable
-rw-r--r--custom_mutators/symqemu/Makefile2
-rw-r--r--src/afl-fuzz.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/custom_mutators/symqemu/Makefile b/custom_mutators/symqemu/Makefile
index 3361ab0f..958aec19 100644
--- a/custom_mutators/symqemu/Makefile
+++ b/custom_mutators/symqemu/Makefile
@@ -8,7 +8,7 @@ all: symqemu-mutator.so
CFLAGS += -O3 -funroll-loops
symqemu-mutator.so: symqemu.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -g -I../../include -shared -fPIC -o symqemu-mutator.so symqemu.c
+ $(CC) -g $(CFLAGS) $(CPPFLAGS) -g -I../../include -shared -fPIC -o symqemu-mutator.so symqemu.c
clean:
rm -f symqemu-mutator.so *.o *~ core
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index e2d8dea5..a61718a7 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -1833,7 +1833,7 @@ int main(int argc, char **argv_orig, char **envp) {
}
- {
+ if (!getenv("AFL_CUSTOM_INFO_PROGRAM_ARGV")) {
u8 envbuf[8096] = "", tmpbuf[8096] = "";
for (s32 i = optind + 1; i < argc; ++i) {
@@ -1864,7 +1864,11 @@ int main(int argc, char **argv_orig, char **envp) {
}
- setenv("AFL_CUSTOM_INFO_OUT", afl->out_dir, 1); // same as __AFL_OUT_DIR
+ if (!getenv("AFL_CUSTOM_INFO_OUT") {
+
+ setenv("AFL_CUSTOM_INFO_OUT", afl->out_dir, 1); // same as __AFL_OUT_DIR
+
+ }
setup_custom_mutators(afl);