diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-13 05:56:46 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:03 -0500 |
commit | e1fa7352ca0c27516f61e85ddf38477a70f12331 (patch) | |
tree | adc8940b2756f2d887b31479b666d3e996db5149 /source4/lib/ldb/common | |
parent | 9cb3b2d49bf4093f9eff8cd26a0c9c994da5d096 (diff) | |
download | samba-e1fa7352ca0c27516f61e85ddf38477a70f12331.tar.gz samba-e1fa7352ca0c27516f61e85ddf38477a70f12331.tar.bz2 samba-e1fa7352ca0c27516f61e85ddf38477a70f12331.zip |
r7516: make sure binary decoding gives us something we can run string functions on
(This used to be commit 9913ab2550fae465c7a66fe7fa3a36a65b25b358)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r-- | source4/lib/ldb/common/ldb_parse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/lib/ldb/common/ldb_parse.c b/source4/lib/ldb/common/ldb_parse.c index 80841054c6..40e83f01bd 100644 --- a/source4/lib/ldb/common/ldb_parse.c +++ b/source4/lib/ldb/common/ldb_parse.c @@ -136,7 +136,7 @@ struct ldb_val ldb_binary_decode(TALLOC_CTX *ctx, const char *str) struct ldb_val ret; int slen = strlen(str); - ret.data = talloc_size(ctx, slen); + ret.data = talloc_size(ctx, slen+1); ret.length = 0; if (ret.data == NULL) return ret; @@ -155,6 +155,7 @@ struct ldb_val ldb_binary_decode(TALLOC_CTX *ctx, const char *str) } } ret.length = j; + ((uint8_t *)ret.data)[j] = 0; return ret; } |