summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-11-29 14:42:31 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-11-29 14:51:50 +0100
commitdf1d42fc1b5fd27a8969819212f51a74b310d909 (patch)
tree2f5e4f4b9b61a8e3a1e7f18e22c9e69e72928af8 /source4/lib/registry
parent69a68208bd971dbe9905dedd0554b3a79d2d2ce6 (diff)
downloadsamba-df1d42fc1b5fd27a8969819212f51a74b310d909.tar.gz
samba-df1d42fc1b5fd27a8969819212f51a74b310d909.tar.bz2
samba-df1d42fc1b5fd27a8969819212f51a74b310d909.zip
Revert "s4:registry/util - Don't include the trailing '\0' in the internal data format but add it on the back-conversion to a string"
This reverts commit 7d400715e9af2056690c03a1a2f45c7f343fa313. "convert_string_talloc_convenience" does always add the NULL termination. Didn't know that. Thanks Jelmer for pointing out!
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/util.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c
index 764660121f..9409a8f4bc 100644
--- a/source4/lib/registry/util.c
+++ b/source4/lib/registry/util.c
@@ -56,7 +56,6 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx,
const DATA_BLOB data)
{
char *ret = NULL;
- size_t ret_cnt;
if (data.length == 0)
return talloc_strdup(mem_ctx, "");
@@ -70,9 +69,7 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx,
data.data,
data.length,
(void **)&ret,
- &ret_cnt, false);
- ret = talloc_realloc(mem_ctx, ret, char, ret_cnt + 1);
- ret[ret_cnt] = '\0';
+ NULL, false);
break;
case REG_BINARY:
ret = data_blob_hex_string_upper(mem_ctx, &data);
@@ -136,10 +133,9 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx,
iconv_convenience,
CH_UNIX, CH_UTF16,
data_str,
- strlen(data_str),
+ strlen(data_str)+1,
(void **)&data->data,
&data->length, false);
-
break;
case REG_DWORD: {