fortify-headers

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

commit c3b48c6b0bf501802295c85b1cf54275d6b74883
parent f8155f0b945c5cfb3600d7c146a5d86870ed09d2
Author: jvoisin <julien.voisin@dustri.org>
Date:   Thu, 10 Oct 2024 01:20:07 +0200

Disable snprintf/sprintf hardening for now

Diffstat:
Minclude/stdio.h | 2++
Mtests/test_asprintf.c | 2++
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/stdio.h b/include/stdio.h @@ -243,6 +243,7 @@ _FORTIFY_FN(vasprintf) int vasprintf(char **strp, const char *fmt, __builtin_va_ #endif // __clang__ +#if 0 #if __has_builtin(__builtin_va_arg_pack) /* clang is missing __builtin_va_arg_pack, so we cannot use these impls @@ -356,6 +357,7 @@ _FORTIFY_FN(asprintf) int asprintf(char **strp, const char *fmt, ...) #pragma GCC diagnostic pop #endif /* __has_builtin(__builtin_va_arg_pack) */ +#endif #ifdef __cplusplus } diff --git a/tests/test_asprintf.c b/tests/test_asprintf.c @@ -11,10 +11,12 @@ int main(int argc, char** argv) { puts(buf); free(buf); +#if 0 #ifndef __clang__ asprintf(&buf, "total: %", 1); assert(buf == NULL); #endif +#endif return 0; }