summaryrefslogtreecommitdiff
path: root/source4/lib/data_blob.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-04-30 09:04:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:23 -0500
commit98549af7bf1932bbc78a07053f193b24bd8685f7 (patch)
tree88684d90249d0fa3ef49279b600d086db36610dc /source4/lib/data_blob.c
parent77255b7f9c5204c8ced541730562e028772b5d35 (diff)
downloadsamba-98549af7bf1932bbc78a07053f193b24bd8685f7.tar.gz
samba-98549af7bf1932bbc78a07053f193b24bd8685f7.tar.bz2
samba-98549af7bf1932bbc78a07053f193b24bd8685f7.zip
r6528: - in tdb_fetch() we effectively disallowed zero length records by
returning NULL/0, which is the same as we used for a failure. Having to look at tdb->ecode (which we never do) is too error prone. Instead, tdb_fetch() should behave like malloc() and talloc(), where zero length is not special and malloc(0) returns a valid pointer. - similarly in data_blob(), asking for data_blob(NULL, 0) should return a zero blob, but asking for data_blob(ptr, 0) should return a zero length blob with a valid pointer, just like talloc() and malloc() This change fixes the SummaryInformation stream stored in the tdb backend when manipulated from w2k. The w2k client was using SET_EOF_INFORMATION to create a zero-length stream, which we return STATUS_NOT_FOUND on, as the tdb_fetch() gave us back a NULL/0 blob, which we returned as not-found (This used to be commit 162bbe4402b9de6ac06103df904b9fc204fbff29)
Diffstat (limited to 'source4/lib/data_blob.c')
-rw-r--r--source4/lib/data_blob.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/lib/data_blob.c b/source4/lib/data_blob.c
index 284db4518f..2ec21717b1 100644
--- a/source4/lib/data_blob.c
+++ b/source4/lib/data_blob.c
@@ -29,7 +29,7 @@ DATA_BLOB data_blob_named(const void *p, size_t length, const char *name)
{
DATA_BLOB ret;
- if (length == 0) {
+ if (p == NULL && length == 0) {
ZERO_STRUCT(ret);
return ret;
}