summaryrefslogtreecommitdiff
path: root/source4/lib/util/data_blob.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-08-21 19:24:58 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-08-21 19:24:58 +1000
commit4ad97a1d0593b3401a352407009a99ead23f21f2 (patch)
tree31e546187b08304190e6e2ad579672caccaf02c1 /source4/lib/util/data_blob.c
parent38f740529803054a3145ad547b3d7de8a25e983a (diff)
downloadsamba-4ad97a1d0593b3401a352407009a99ead23f21f2.tar.gz
samba-4ad97a1d0593b3401a352407009a99ead23f21f2.tar.bz2
samba-4ad97a1d0593b3401a352407009a99ead23f21f2.zip
Don't walk past the end of ldb values.
This is a partial fix towards bugs due to us walking past the end of what we think are strings in ldb. There is much more work to do in this area. Andrew Bartlett (This used to be commit 5805a9a8f35fd90fa4f718f73534817fa3bbdfd2)
Diffstat (limited to 'source4/lib/util/data_blob.c')
-rw-r--r--source4/lib/util/data_blob.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/lib/util/data_blob.c b/source4/lib/util/data_blob.c
index b258e47bba..57b34b7ae7 100644
--- a/source4/lib/util/data_blob.c
+++ b/source4/lib/util/data_blob.c
@@ -176,7 +176,7 @@ _PUBLIC_ DATA_BLOB data_blob_string_const(const char *str)
{
DATA_BLOB blob;
blob.data = discard_const_p(uint8_t, str);
- blob.length = strlen(str);
+ blob.length = str ? strlen(str) : 0;
return blob;
}