From 021e25b5c0a098fc4e2b27a31abb34cb32b76be5 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 16 Dec 2023 00:51:48 +0100 Subject: Disable str(r)chr hardening It's UB to subtract null pointers, which these potentially may be. It also makes python test suite fail. --- include/string.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/string.h b/include/string.h index eb6cc90..2f2d185 100644 --- 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) \ -- cgit v1.3