From ad7c3ea0f0918f09283ab28e4fe99f1156ab52f1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 30 May 2001 06:23:05 +0000 Subject: merged fix for tdb_unpack from 2_2 (This used to be commit 200b682e9bbe79897343422f7c870382ed6de40a) --- source3/tdb/tdbutil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c index 409397366a..0a2f1f84d4 100644 --- a/source3/tdb/tdbutil.c +++ b/source3/tdb/tdbutil.c @@ -292,7 +292,10 @@ int tdb_unpack(char *buf, int bufsize, char *fmt, ...) len = 4; if (bufsize < len) goto no_space; *i = IVAL(buf, 0); - if (! *i) break; + if (! *i) { + *b = NULL; + break; + } len += *i; if (bufsize < len) goto no_space; *b = (char *)malloc(*i); -- cgit