fortify-headers

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

commit fea08b7aef9cd235d6ae384c1fd6e9578dc952c4
parent 5e0ea3e3fca14587b4494f604c887761dc4f5a17
Author: jvoisin <julien.voisin@dustri.org>
Date:   Sun, 20 Aug 2023 16:43:31 +0200

Remove memrchr hardening for now

It doesn't play nice with gcc.

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

diff --git a/include/string.h b/include/string.h @@ -91,19 +91,6 @@ _FORTIFY_FN(memchr) void *memchr(const void * _FORTIFY_POS0 __d, int __c, size_t return __builtin_memchr(__d, __c, __n); } -#if defined(_GNU_SOURCE) -#undef memrchr -__access(read_only, 1, 3) -_FORTIFY_FN(memrchr) void *memrchr(const void * _FORTIFY_POS0 __d, int __c, size_t __n) -{ - size_t __b = __bos(__d, 0); - - if (__n > __b) - __builtin_trap(); - return __builtin_memrchr(__d, __c, __n); -} -#endif - #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE)