diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2008-09-15 17:21:35 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-10-21 14:40:41 +0200 |
commit | c26cb44e0328aaba1d81cb4bd09b37252c7a725b (patch) | |
tree | ed8e1e5b5d57e685ed2540b327cbffb096617231 /source4/lib/registry | |
parent | b23c3c24c2ffa8c8fa73ae90947d7e0a01b796c0 (diff) | |
download | samba-c26cb44e0328aaba1d81cb4bd09b37252c7a725b.tar.gz samba-c26cb44e0328aaba1d81cb4bd09b37252c7a725b.tar.bz2 samba-c26cb44e0328aaba1d81cb4bd09b37252c7a725b.zip |
Revert "Registry server "reg_ldb_unpack_value": Let "data" pointer be NULL"
This reverts commit 82f50ea69f3aece4ac654ffdfa627babd8aadc25.
Cause: Windows (2000) doesn't accept the "data" pointer set to NULL
Diffstat (limited to 'source4/lib/registry')
-rw-r--r-- | source4/lib/registry/ldb.c | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index d15fdb3457..be844d75d5 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -54,39 +54,35 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx, value_type = ldb_msg_find_attr_as_uint(msg, "type", 0); if (type != NULL) *type = value_type; + val = ldb_msg_find_ldb_val(msg, "data"); - if (data != NULL) { - val = ldb_msg_find_ldb_val(msg, "data"); - - switch (value_type) - { - case REG_SZ: - case REG_EXPAND_SZ: - data->length = convert_string_talloc(mem_ctx, - iconv_convenience, CH_UNIX, CH_UTF16, + switch (value_type) + { + case REG_SZ: + case REG_EXPAND_SZ: + data->length = convert_string_talloc(mem_ctx, iconv_convenience, CH_UNIX, CH_UTF16, val->data, val->length, (void **)&data->data); - break; - - case REG_BINARY: - if (val != NULL) - *data = strhex_to_data_blob((char *)val->data); - else { - data->data = NULL; - data->length = 0; - } - break; + break; - case REG_DWORD: { - uint32_t tmp = strtoul((char *)val->data, NULL, 0); - *data = data_blob_talloc(mem_ctx, &tmp, 4); - } - break; + case REG_BINARY: + if (val) + *data = strhex_to_data_blob((char *)val->data); + else { + data->data = NULL; + data->length = 0; + } + break; - default: - *data = data_blob_talloc(mem_ctx, val->data, val->length); - break; + case REG_DWORD: { + uint32_t tmp = strtoul((char *)val->data, NULL, 0); + *data = data_blob_talloc(mem_ctx, &tmp, 4); } + break; + + default: + *data = data_blob_talloc(mem_ctx, val->data, val->length); + break; } } |