]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
m4: dovecot.m4 - Enable addresss sanitizer for fuzzer
authorStephan Bosch <stephan.bosch@open-xchange.com>
Thu, 4 Dec 2025 22:13:50 +0000 (23:13 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 2 Feb 2026 18:54:43 +0000 (18:54 +0000)
m4/dovecot.m4

index c73f43d1cd1798a95bb739dcf5ccb933a1709164..0aa6a574ea4be6685cb091d825b7ac16c08302b8 100644 (file)
@@ -6,7 +6,7 @@ dnl This file is free software; the authors give
 dnl unlimited permission to copy and/or distribute it, with or without
 dnl modifications, as long as this notice is preserved.
 
-# serial 46
+# serial 47
 
 dnl
 dnl Check for support for D_FORTIFY_SOURCE=2
@@ -374,13 +374,13 @@ AC_DEFUN([DC_DOVECOT_FUZZER],[
                 with_fuzzer=$withval,
                 with_fuzzer=no)
        AS_IF([test x$with_fuzzer = xclang], [
-               AM_CFLAGS="$AM_CFLAGS -fsanitize=fuzzer-no-link"
+               AM_CFLAGS="$AM_CFLAGS -fsanitize=fuzzer-no-link -fsanitize=address"
                AM_CFLAGS="$AM_CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
                # use $LIB_FUZZING_ENGINE for linking if it exists
-               FUZZER_LDFLAGS=${LIB_FUZZING_ENGINE--fsanitize=fuzzer}
+               FUZZER_LDFLAGS=${LIB_FUZZING_ENGINE--fsanitize=fuzzer -fsanitize=address}
                # May need to use CXXLINK for linking, which wants sources to
                # be compiled with -fPIE
-               FUZZER_CPPFLAGS='$(AM_CPPFLAGS) -fPIE -DPIE'
+               FUZZER_CPPFLAGS='$(AM_CPPFLAGS) -fPIE -DPIE -fsanitize=address'
        ], [test x$with_fuzzer != xno], [
                AC_MSG_ERROR([Unknown fuzzer $with_fuzzer])
        ])