./configure \
CPPFLAGS='-Wall'\
CFLAGS='-g3 -O2'\
-' -D_FORTIFY_SOURCE=2'\
+' -D_FORTIFY_SOURCE=3'\
' -fsanitize=undefined'\
' -fsanitize-undefined-trap-on-error'
@end example
@itemize @bullet
@item
-@code{-D_FORTIFY_SOURCE=2} enables extra security hardening checks in
+@code{-D_FORTIFY_SOURCE=3} enables extra security hardening checks in
the GNU C library.
@item
@code{-fsanitize=undefined} enables GCC's undefined behavior sanitizer
structure managed by the kernel.
@item
This function may crash when the invoker code was compiled with option
-@code{-D_FORTIFY_SOURCE=2},
+@code{_FORTIFY_SOURCE >= 2}
@c https://sourceware.org/PR32522
on Hurd.
@end itemize
/* The following platforms forbid %n:
- On glibc2 systems from 2004-10-18 or newer, the use of
%n in format strings in writable memory may crash the
- program (if compiled with _FORTIFY_SOURCE=2).
+ program (if compiled with _FORTIFY_SOURCE >= 2).
- On macOS 10.13 or newer, the use of %n in format
strings in writable memory by default crashes the
program.
_CrtSetReportMode (_CRT_ASSERT, 0);
#endif
signal (SIGABRT, abort_handler);
- /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
+ /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE >= 2)
support %n in format strings in read-only memory but not in writable
memory. */
strcpy (fmtstring, "%d %n");
{
int count = -1;
signal (SIGABRT, abort_handler);
- /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
+ /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE >= 2)
support %n in format strings in read-only memory but not in writable
memory. */
strcpy (fmtstring, "%d %n");
#include <config.h>
-/* On GNU/Hurd, when compiling with -D_FORTIFY_SOURCE=2, avoid an error
+/* On GNU/Hurd, when compiling with _FORTIFY_SOURCE >= 2, avoid an error
"*** longjmp causes uninitialized stack frame ***: terminated".
Cf. <https://sourceware.org/PR32522> */
#ifdef __gnu_hurd__
#include <config.h>
-/* On GNU/Hurd, when compiling with -D_FORTIFY_SOURCE=2, avoid an error
+/* On GNU/Hurd, when compiling with _FORTIFY_SOURCE >= 2, avoid an error
"*** longjmp causes uninitialized stack frame ***: terminated".
Cf. <https://sourceware.org/PR32522> */
#ifdef __gnu_hurd__