summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/common/ldb_parse.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_parse.c b/source4/lib/ldb/common/ldb_parse.c
index 746002e34a..0203f3299f 100644
--- 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);