diff options
author | van Hauser <vh@thc.org> | 2021-04-04 15:28:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-04 15:28:42 +0200 |
commit | c23183f1dc39ce0792a879065e6aea33a4c571f8 (patch) | |
tree | 68acaf32c888de02334d15814743c1463c564c15 /src/afl-cc.c | |
parent | 53facd8882173873a7b78860b0fb49884de90c5b (diff) | |
parent | 99819cf5d1cbc262810f26098a5796c9d1262bc5 (diff) | |
download | afl++-c23183f1dc39ce0792a879065e6aea33a4c571f8.tar.gz |
Merge pull request #855 from MegaManSec/leak-sanitizer
Add support for standalone leak-sanitizer
Diffstat (limited to 'src/afl-cc.c')
-rw-r--r-- | src/afl-cc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c index b354077e..d4c0a6b7 100644 --- a/src/afl-cc.c +++ b/src/afl-cc.c @@ -819,6 +819,13 @@ static void edit_params(u32 argc, char **argv, char **envp) { } + if (getenv("AFL_USE_LSAN")) { + cc_params[cc_par_cnt++] = "-fsanitize=leak"; + cc_params[cc_par_cnt++] = "-includesanitizer/lsan_interface.h"; + cc_params[cc_par_cnt++] = + "-D__AFL_LEAK_CHECK()=__lsan_do_leak_check()"; + } + if (getenv("AFL_USE_CFISAN")) { if (!lto_mode) { @@ -1730,7 +1737,8 @@ int main(int argc, char **argv, char **envp) { " AFL_USE_ASAN: activate address sanitizer\n" " AFL_USE_CFISAN: activate control flow sanitizer\n" " AFL_USE_MSAN: activate memory sanitizer\n" - " AFL_USE_UBSAN: activate undefined behaviour sanitizer\n"); + " AFL_USE_UBSAN: activate undefined behaviour sanitizer\n" + " AFL_USE_LSAN: activate leak-checker sanitizer\n"); if (have_gcc_plugin) SAYF( |