r10656: BIG merge from trunk. Features not copied over
[samba.git] / source3 / tdb / tdbutil.c
index 47f1bb2dc24d5df46d737dc1004d925063336a9a..e27880e5ea051ab71090e425466bfa3d3dce66c9 100644 (file)
@@ -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 *);