git.samba.org
/
bbaumbach
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d4576b
)
ldb-dn: don't crash on NULL in ldb_binary_encode_string()
author
Andrew Tridgell
<tridge@samba.org>
Wed, 29 Sep 2010 01:01:21 +0000
(18:01 -0700)
committer
Andrew Tridgell
<tridge@samba.org>
Wed, 29 Sep 2010 02:25:51 +0000
(19:25 -0700)
Thanks to Nadya for finding this one!
source4/lib/ldb/common/ldb_parse.c
patch
|
blob
|
history
diff --git
a/source4/lib/ldb/common/ldb_parse.c
b/source4/lib/ldb/common/ldb_parse.c
index 746002e34a7948d727a552f3f6f22bb117309a54..0203f3299f467ce7288e1d9fafb391d4ed395363 100644
(file)
--- a/
source4/lib/ldb/common/ldb_parse.c
+++ b/
source4/lib/ldb/common/ldb_parse.c
@@
-154,6
+154,9
@@
char *ldb_binary_encode(TALLOC_CTX *mem_ctx, struct ldb_val val)
char *ldb_binary_encode_string(TALLOC_CTX *mem_ctx, const char *string)
{
struct ldb_val val;
+ if (string == NULL) {
+ return NULL;
+ }
val.data = discard_const_p(uint8_t, string);
val.length = strlen(string);
return ldb_binary_encode(mem_ctx, val);