diff options
Diffstat (limited to 'source4/lib/registry')
-rw-r--r-- | source4/lib/registry/regf.c | 7 |
1 files changed, 5 insertions, 2 deletions
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 { |