commit 2c07a3a: [Minor] Support gcc based ASAN

Vsevolod Stakhov vsevolod at highsecure.ru
Sat Jun 22 12:14:59 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-06-21 21:13:41 +0100
URL: https://github.com/rspamd/rspamd/commit/2c07a3a16133003f278fd19b023b5cdd41ad41d7

[Minor] Support gcc based ASAN

---
 src/libutil/str_util.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h
index 8e8898a32..6fbb11ccf 100644
--- a/src/libutil/str_util.h
+++ b/src/libutil/str_util.h
@@ -83,10 +83,18 @@ gsize rspamd_strlcpy_safe (gchar *dst, const gchar *src, gsize siz);
 #  if __has_feature(address_sanitizer)
 #    define rspamd_strlcpy rspamd_strlcpy_safe
 #  else
-#    define rspamd_strlcpy rspamd_strlcpy_fast
+#    ifdef __SANITIZE_ADDRESS__
+#      define rspamd_strlcpy rspamd_strlcpy_safe
+#    else
+#      define rspamd_strlcpy rspamd_strlcpy_fast
+#    endif
 #  endif
 #else
-#  define rspamd_strlcpy rspamd_strlcpy_fast
+#  ifdef __SANITIZE_ADDRESS__
+#    define rspamd_strlcpy rspamd_strlcpy_safe
+#  else
+#    define rspamd_strlcpy rspamd_strlcpy_fast
+#  endif
 #endif
 
 /**


More information about the Commits mailing list