From ef3490e79959a3c4366f6981c67dbe5e529a3738 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Thu, 8 Apr 2010 15:19:07 +0200 Subject: s4:registry - "REGF backend" - don't ignore wrong-sized REG_DWORD/REG_DWORD_BIG_ENDIAN values --- source4/lib/registry/regf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source4/lib/registry/regf.c') diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c index 615389e0e8..3888b8e3ab 100644 --- a/source4/lib/registry/regf.c +++ b/source4/lib/registry/regf.c @@ -1822,8 +1822,11 @@ static WERROR regf_set_value(struct hive_key *key, const char *name, /* Set the type and data */ vk.data_length = data.length; vk.data_type = type; - if ((data.length == sizeof(uint32_t)) && - ((type == REG_DWORD) || (type == REG_DWORD_BIG_ENDIAN))) { + if ((type == REG_DWORD) || (type == REG_DWORD_BIG_ENDIAN)) { + if (vk.data_length != sizeof(uint32_t)) { + DEBUG(0, ("DWORD or DWORD_BIG_ENDIAN value with size other than 4 byte!\n")); + return WERR_NOT_SUPPORTED; + } vk.data_length |= 0x80000000; vk.data_offset = IVAL(data.data, 0); } else { -- cgit