From 0c5214e2eb6249914230f092fe35dfa49da24c34 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 29 Mar 2011 11:16:26 -0700 Subject: Ensure convert_string_XXX is always called with a valid converted_size pointer. Preparation for cleaning up this API. Autobuild-User: Jeremy Allison Autobuild-Date: Tue Mar 29 21:01:49 CEST 2011 on sn-devel-104 --- source4/lib/registry/patchfile_dotreg.c | 3 ++- source4/lib/registry/util.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/lib/registry') diff --git a/source4/lib/registry/patchfile_dotreg.c b/source4/lib/registry/patchfile_dotreg.c index 073c12e345..c4409dcf9c 100644 --- a/source4/lib/registry/patchfile_dotreg.c +++ b/source4/lib/registry/patchfile_dotreg.c @@ -70,6 +70,7 @@ static char *dotreg_data_blob_hex_string(TALLOC_CTX *mem_ctx, const DATA_BLOB *b static char *reg_val_dotreg_string(TALLOC_CTX *mem_ctx, uint32_t type, const DATA_BLOB data) { + size_t converted_size = 0; char *ret = NULL; if (data.length == 0) @@ -80,7 +81,7 @@ static char *reg_val_dotreg_string(TALLOC_CTX *mem_ctx, uint32_t type, case REG_SZ: convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, data.data, data.length, - (void **)&ret, NULL); + (void **)&ret, &converted_size); break; case REG_DWORD: case REG_DWORD_BIG_ENDIAN: diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c index 3bbfaf2454..1197adba7f 100644 --- a/source4/lib/registry/util.c +++ b/source4/lib/registry/util.c @@ -26,6 +26,7 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, uint32_t type, const DATA_BLOB data) { + size_t converted_size = 0; char *ret = NULL; if (data.length == 0) @@ -37,7 +38,7 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, uint32_t type, convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, data.data, data.length, - (void **)&ret, NULL); + (void **)&ret, &converted_size); break; case REG_DWORD: case REG_DWORD_BIG_ENDIAN: -- cgit