From 15e84a9a09c5a86416e964a3258ee35718fbf45a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 24 Mar 2011 10:59:41 +1100 Subject: charcnv: removed the allow_badcharcnv and allow_bad_conv options to convert_string*() we shouldn't accept bad multi-byte strings, it just hides problems Autobuild-User: Andrew Tridgell Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104 --- source4/lib/registry/ldb.c | 5 ++--- source4/lib/registry/patchfile_dotreg.c | 4 ++-- source4/lib/registry/tests/generic.c | 6 +++--- source4/lib/registry/util.c | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) (limited to 'source4/lib/registry') diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index a6f00aa330..5244a2061b 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -65,7 +65,7 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx, /* The data should be provided as UTF16 string */ convert_string_talloc(mem_ctx, CH_UTF8, CH_UTF16, val->data, val->length, - (void **)&data->data, &data->length, false); + (void **)&data->data, &data->length); } else { data->data = NULL; data->length = 0; @@ -159,8 +159,7 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx, /* The data is provided as UTF16 string */ ret2 = convert_string_talloc(mem_ctx, CH_UTF16, CH_UTF8, (void *)data.data, data.length, - (void **)&val->data, &val->length, - false); + (void **)&val->data, &val->length); if (ret2) { ret = ldb_msg_add_value(msg, "data", val, NULL); } else { diff --git a/source4/lib/registry/patchfile_dotreg.c b/source4/lib/registry/patchfile_dotreg.c index 8fac00ba44..073c12e345 100644 --- a/source4/lib/registry/patchfile_dotreg.c +++ b/source4/lib/registry/patchfile_dotreg.c @@ -79,8 +79,8 @@ static char *reg_val_dotreg_string(TALLOC_CTX *mem_ctx, uint32_t type, case REG_EXPAND_SZ: case REG_SZ: convert_string_talloc(mem_ctx, - CH_UTF16, CH_UNIX, data.data, data.length, - (void **)&ret, NULL, false); + CH_UTF16, CH_UNIX, data.data, data.length, + (void **)&ret, NULL); break; case REG_DWORD: case REG_DWORD_BIG_ENDIAN: diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c index 68fcdd593d..2ef6f84700 100644 --- a/source4/lib/registry/tests/generic.c +++ b/source4/lib/registry/tests/generic.c @@ -91,7 +91,7 @@ static bool test_reg_val_data_string_sz(struct torture_context *ctx) { DATA_BLOB db; convert_string_talloc(ctx, CH_UTF8, CH_UTF16, - "bla", 3, (void **)&db.data, &db.length, false); + "bla", 3, (void **)&db.data, &db.length); torture_assert_str_equal(ctx, "bla", reg_val_data_string(ctx, REG_SZ, db), "sz failed"); @@ -128,7 +128,7 @@ static bool test_reg_val_description(struct torture_context *ctx) convert_string_talloc(ctx, CH_UTF8, CH_UTF16, "stationary traveller", strlen("stationary traveller"), - (void **)&data.data, &data.length, false); + (void **)&data.data, &data.length); torture_assert_str_equal(ctx, "camel = REG_SZ : stationary traveller", reg_val_description(ctx, "camel", REG_SZ, data), "reg_val_description failed"); @@ -142,7 +142,7 @@ static bool test_reg_val_description_nullname(struct torture_context *ctx) convert_string_talloc(ctx, CH_UTF8, CH_UTF16, "west berlin", strlen("west berlin"), - (void **)&data.data, &data.length, false); + (void **)&data.data, &data.length); torture_assert_str_equal(ctx, " = REG_SZ : west berlin", reg_val_description(ctx, NULL, REG_SZ, data), "description with null name failed"); diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c index bbcc869e03..3bbfaf2454 100644 --- a/source4/lib/registry/util.c +++ b/source4/lib/registry/util.c @@ -37,7 +37,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, false); + (void **)&ret, NULL); break; case REG_DWORD: case REG_DWORD_BIG_ENDIAN: @@ -162,7 +162,7 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx, const char *type_str, CH_UNIX, CH_UTF16, data_str, strlen(data_str)+1, (void **)&data->data, - &data->length, false); + &data->length); break; case REG_MULTI_SZ: case REG_EXPAND_SZ: -- cgit