summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-22 22:07:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:44 -0500
commit44bac2bf7b8537a7cd414a883b5c89042c6ad179 (patch)
tree146277e487f63fbd00b6995a462cdd0ccbd979ab /source3/lib
parent9aba116607c0b85a371c3556a6483bc662c769a3 (diff)
downloadsamba-44bac2bf7b8537a7cd414a883b5c89042c6ad179.tar.gz
samba-44bac2bf7b8537a7cd414a883b5c89042c6ad179.tar.bz2
samba-44bac2bf7b8537a7cd414a883b5c89042c6ad179.zip
r4334: Fix for bugid #2186 - from Buck Huppmann <buckh@pobox.com>
to prevent uninitialized creds being freed. Jeremy. (This used to be commit c3f9c81a8fcb26f7110f75b3096d5d1eb30aac13)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_str.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index c6b6570f5c..6ebada94d7 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1527,6 +1527,9 @@ int fstr_sprintf(fstring s, const char *fmt, ...)
/**
Some platforms don't have strndup.
**/
+#if defined(PARANOID_MALLOC_CHECKER)
+#undef strndup
+#endif
char *strndup(const char *s, size_t n)
{
@@ -1541,6 +1544,11 @@ int fstr_sprintf(fstring s, const char *fmt, ...)
return ret;
}
+
+#if defined(PARANOID_MALLOC_CHECKER)
+#define strndup(s,n) __ERROR_DONT_USE_STRNDUP_DIRECTLY
+#endif
+
#endif
#if !defined(HAVE_STRNLEN) || defined(BROKEN_STRNLEN)