aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2024-01-25 01:51:49 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-25 01:51:49 -0500
commit80a83a8f6aebd4c5f0d2a21bfbfe5d7cffd1fc9b (patch)
tree2dfc5ce8dede3a31a91d9034ccc975cb74bc63f8
parentdumpelf: free elf after fuzzing it to avoid leaking (diff)
downloadpax-utils-80a83a8f6aebd4c5f0d2a21bfbfe5d7cffd1fc9b.tar.gz
pax-utils-80a83a8f6aebd4c5f0d2a21bfbfe5d7cffd1fc9b.tar.bz2
pax-utils-80a83a8f6aebd4c5f0d2a21bfbfe5d7cffd1fc9b.zip
sanitizer: fix feature tests under clang
While gcc defines __SANITIZE_ADDRESS__, clang requires more verbose tests. Add them to make the cleanup/security logic work correctly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--porting.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/porting.h b/porting.h
index 103d268..6c0da01 100644
--- a/porting.h
+++ b/porting.h
@@ -74,6 +74,13 @@
#endif
#undef PAX_UTILS_CLEANUP
+#ifndef __SANITIZE_ADDRESS__
+# ifdef __has_feature
+# if __has_feature (address_sanitizer)
+# define __SANITIZE_ADDRESS__ 1
+# endif
+# endif
+#endif
/* LSAN (Leak Sanitizer) will complain about things we leak. */
#ifdef __SANITIZE_ADDRESS__
# define PAX_UTILS_CLEANUP 1