summaryrefslogtreecommitdiff
path: root/source3/tdb/tdbutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/tdb/tdbutil.c')
-rw-r--r--source3/tdb/tdbutil.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c
index 47f1bb2dc2..e27880e5ea 100644
--- a/source3/tdb/tdbutil.c
+++ b/source3/tdb/tdbutil.c
@@ -566,7 +566,12 @@ int tdb_unpack(char *buf, int bufsize, const char *fmt, ...)
p = va_arg(ap, void **);
if (bufsize < len)
goto no_space;
- *p = (void *)IVAL(buf, 0);
+ /*
+ * This isn't a real pointer - only a token (1 or 0)
+ * to mark the fact a pointer is present.
+ */
+
+ *p = (void *)(IVAL(buf, 0) ? (void *)1 : NULL);
break;
case 'P':
s = va_arg(ap,char *);