From a6f5e495b1aa87982ee69c17b098e27010bed756 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 23 Mar 2010 00:24:32 +0100 Subject: s4:registry - "LDB backend" - revert the length check for UTF16 strings Let this do the "convert_string_talloc" function as it was before. --- source4/lib/registry/ldb.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index ec0b33ab80..a4675c8a7e 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -155,16 +155,11 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx, return NULL; } - /* Only when the "data.length" is dividable by two try - * the charset conversion, otherwise stick with the - * default of the "ret2" variable set to "false". */ - if (data.length % 2 == 0) { - /* 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); - } + /* 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); if (ret2) { ret = ldb_msg_add_value(msg, "data", val, NULL); } -- cgit