From 2c07a3a16133003f278fd19b023b5cdd41ad41d7 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 21 Jun 2019 21:13:41 +0100 Subject: [PATCH] [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 /** -- 2.39.5