summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-04-08 15:19:07 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-04-08 15:29:40 +0200
commitef3490e79959a3c4366f6981c67dbe5e529a3738 (patch)
tree59cd7d660057c67af30472fee8ce1addc1106485 /source4/lib/registry
parent3d5732fc1392740c5147c39116e5853452d0dc54 (diff)
downloadsamba-ef3490e79959a3c4366f6981c67dbe5e529a3738.tar.gz
samba-ef3490e79959a3c4366f6981c67dbe5e529a3738.tar.bz2
samba-ef3490e79959a3c4366f6981c67dbe5e529a3738.zip
s4:registry - "REGF backend" - don't ignore wrong-sized REG_DWORD/REG_DWORD_BIG_ENDIAN values
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/regf.c7
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 {