From 33ffb31a498186131224ddab11291d81ec0da2a8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 26 May 2006 02:25:00 +0000 Subject: r15896: we're getting a lot of crashes on the build farm due to people assuming that printf("%s", NULL) is OK. The problem is that it is ok with recent versions of glibc, so the bug isn't noticed by most developers. This configure change ensures that we replace snprintf() if it doesn't handle NULL strings. Then we just need to make sure we use d_printf() instead of printf() in torture tests to display possibly NULL strings. (This used to be commit dcce824080f3437c835b32381b73380fab720554) --- source4/lib/replace/config.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/source4/lib/replace/config.m4 b/source4/lib/replace/config.m4 index 2cee65e6a6..b925dd52ea 100644 --- a/source4/lib/replace/config.m4 +++ b/source4/lib/replace/config.m4 @@ -107,6 +107,7 @@ void foo(const char *format, ...) { if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1); if (snprintf(buf, 20, "%lld", l) != 12 || strcmp(buf, "123456789000") != 0) exit(1); + if (snprintf(buf, 20, "%s", 0) < 3) exit(1); exit(0); } -- cgit