diff options
author | Wilco Baan Hofman <wilco@baanhofman.nl> | 2010-03-28 17:03:08 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-03-29 18:44:00 +0200 |
commit | 2d6791286b97236136de468ebf4173bd35336b6e (patch) | |
tree | a1ac84c0711d15ee822cb6df532df822bac3d78a /source4/lib/registry | |
parent | 16427efb749d63b5a54b2b260ea8ac565f63a9e7 (diff) | |
download | samba-2d6791286b97236136de468ebf4173bd35336b6e.tar.gz samba-2d6791286b97236136de468ebf4173bd35336b6e.tar.bz2 samba-2d6791286b97236136de468ebf4173bd35336b6e.zip |
Revert "s4:registry - util.c - add harder checks for inputs on "reg_val_data_string""
This reverts commit eb8c8a0ecaa9bfd29f090db21fccdad7751767ae.
Conflicts:
source4/lib/registry/util.c
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4/lib/registry')
-rw-r--r-- | source4/lib/registry/util.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c index e6cd8de640..18eb4ec626 100644 --- a/source4/lib/registry/util.c +++ b/source4/lib/registry/util.c @@ -71,31 +71,27 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, switch (type) { case REG_EXPAND_SZ: case REG_SZ: - if (data.length % 2 == 0) { - convert_string_talloc_convenience(mem_ctx, - iconv_convenience, - CH_UTF16, CH_UNIX, - data.data, - data.length, - (void **)&ret, - NULL, false); - } + convert_string_talloc_convenience(mem_ctx, + iconv_convenience, + CH_UTF16, CH_UNIX, + data.data, + data.length, + (void **)&ret, + NULL, false); break; case REG_BINARY: ret = data_blob_hex_string_upper(mem_ctx, &data); break; case REG_DWORD: case REG_DWORD_BIG_ENDIAN: - if (data.length == sizeof(uint32_t)) { + SMB_ASSERT(data.length == sizeof(uint32_t)); ret = talloc_asprintf(mem_ctx, "0x%8.8x", IVAL(data.data, 0)); - } break; case REG_QWORD: - if (data.length == sizeof(uint64_t)) { - ret = talloc_asprintf(mem_ctx, "0x%16.16llx", - BVAL(data.data, 0)); - } + SMB_ASSERT(data.length == sizeof(uint64_t)); + ret = talloc_asprintf(mem_ctx, "0x%16.16llx", + BVAL(data.data, 0)); break; case REG_NONE: /* "NULL" is the right return value */ |