One should not assume a REG_DWORD is always 4 byte long.
In an enumdata(ex) context, the first reply will return with content
in a buffer that can fill the largest entry in the array of attributes.
All subsequent queries then reuse this buffer even if the key/value
pair in question then is just a 4 byte DWORD. The remaining buffer
will be just empty and of no interest.
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun May 7 03:28:21 CEST 2017 on sn-devel-144
switch(type) {
case REG_DWORD:
- if (blob.length == sizeof(uint32_t)) {
+ if (blob.length >= sizeof(uint32_t)) {
printf("%s: REG_DWORD: 0x%08x\n", name, IVAL(blob.data,0));
} else {
printf("%s: REG_DWORD: <invalid>\n", name);