lib/registry/regf: better initialise nk_block
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 30 Nov 2016 01:19:39 +0000 (14:19 +1300)
committerRalph Boehme <slow@samba.org>
Wed, 30 Nov 2016 19:36:24 +0000 (20:36 +0100)
commit28eb49c7ede1c530f4c27fb4c136e88fd6ba7f93
treeea6484a902b5e5f7f8eb5914df621f6e528a9f2a
parentf5154a86fab60b572f0b77017508a940c55d49e4
lib/registry/regf: better initialise nk_block

We were initialising a uint32_t[5] block with memset(..., 5) when we
surely meant memset(..., 5 * sizeof(uint32_t)) or some equivalent.

Thanks go to gcc-7 and -Wmemset-elt-size. The warning looks like this:

../source4/lib/registry/regf.c: In function ‘reg_create_regf_file’:
../source4/lib/registry/regf.c:2095:2: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  memset(nk.unk3, 0, 5);
    ^~~~~~

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/lib/registry/regf.c