]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Support gcc based ASAN
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 21 Jun 2019 20:13:41 +0000 (21:13 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 22 Jun 2019 09:57:29 +0000 (10:57 +0100)
src/libutil/str_util.h

index 8e8898a32bc68457830303d227a540cab24dee53..6fbb11ccf66f2986da41d6d2e6087089f3c5ec3c 100644 (file)
@@ -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
 
 /**