fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

commit 021e25b5c0a098fc4e2b27a31abb34cb32b76be5
parent a018052d410126f94c2602b208b099839d333b05
Author: q66 <q66@chimera-linux.org>
Date:   Sat, 16 Dec 2023 00:51:48 +0100

Disable str(r)chr hardening

It's UB to subtract null pointers, which these potentially may
be. It also makes python test suite fail.

Diffstat:
Minclude/string.h | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/string.h b/include/string.h @@ -119,6 +119,7 @@ _FORTIFY_FN(memchr) void *memchr(const void * _FORTIFY_POS0 __d, int __c, size_t #endif } +#if 0 __fh_access(read_only, 1, 2) _FORTIFY_FN(strchr) char *strchr(const char * _FORTIFY_POS0 __s, int __c) { @@ -148,6 +149,7 @@ _FORTIFY_FN(strrchr) char *strrchr(const char * _FORTIFY_POS0 __s, int __c) return __r; #endif } +#endif #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \