summaryrefslogtreecommitdiff
path: root/source4/lib/replace
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-05-26 02:25:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:38 -0500
commit33ffb31a498186131224ddab11291d81ec0da2a8 (patch)
tree7fd84a3613fc9dce0f29a83593710c5bd1e0b19e /source4/lib/replace
parentb3a98698ffd815a038ef86ed9b702603713cdeb1 (diff)
downloadsamba-33ffb31a498186131224ddab11291d81ec0da2a8.tar.gz
samba-33ffb31a498186131224ddab11291d81ec0da2a8.tar.bz2
samba-33ffb31a498186131224ddab11291d81ec0da2a8.zip
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)
Diffstat (limited to 'source4/lib/replace')
-rw-r--r--source4/lib/replace/config.m41
1 files changed, 1 insertions, 0 deletions
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);
}