about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorhexcoder <hexcoder-@users.noreply.github.com>2023-11-04 22:01:09 +0100
committerGitHub <noreply@github.com>2023-11-04 22:01:09 +0100
commit8338844284a2a1f340d859e7b0871878537a0729 (patch)
tree3990fcc4fe5f13b72937d37e88cbfa001da8d529 /src
parent7e67dc9d6938aadef19d5697a448cdf15a50172f (diff)
downloadafl++-8338844284a2a1f340d859e7b0871878537a0729.tar.gz
copy 'detect_leaks=0' from ASAN to LSAN
fix for issue #1733, set "detect_leaks=0" when ASAN_OPTIONS contains it and LSAN_OPTIONS are not set.
Diffstat (limited to 'src')
-rw-r--r--src/afl-common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/afl-common.c b/src/afl-common.c
index b4143a1b..9ba7116d 100644
--- a/src/afl-common.c
+++ b/src/afl-common.c
@@ -103,7 +103,12 @@ void set_sanitizer_defaults() {
 
     u8 buf[2048] = "";
     if (!have_san_options) { strcpy(buf, default_options); }
-    strcat(buf, "exitcode=" STRINGIFY(LSAN_ERROR) ":fast_unwind_on_malloc=0:print_suppressions=0:detect_leaks=1:malloc_context_size=30:");
+    if (have_san_options && NULL != strstr(have_asan_options, "detect_leaks=0")) {
+      strcat(buf, "exitcode=" STRINGIFY(LSAN_ERROR) ":fast_unwind_on_malloc=0:print_suppressions=0:detect_leaks=0:malloc_context_size=30:");
+    } else {
+      strcat(buf, "exitcode=" STRINGIFY(LSAN_ERROR) ":fast_unwind_on_malloc=0:print_suppressions=0:detect_leaks=1:malloc_context_size=30:");
+    }
+
     setenv("LSAN_OPTIONS", buf, 1);
 
   }