diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2016-11-30 14:19:39 +1300 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2016-11-30 20:36:24 +0100 |
commit | 28eb49c7ede1c530f4c27fb4c136e88fd6ba7f93 (patch) | |
tree | ea6484a902b5e5f7f8eb5914df621f6e528a9f2a /source4/lib | |
parent | f5154a86fab60b572f0b77017508a940c55d49e4 (diff) | |
download | samba-28eb49c7ede1c530f4c27fb4c136e88fd6ba7f93.tar.gz |
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>
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/registry/regf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c index 887b3353165..763b0ce4319 100644 --- a/source4/lib/registry/regf.c +++ b/source4/lib/registry/regf.c @@ -2092,7 +2092,7 @@ WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx, nk.unknown_offset = -1; nk.num_values = 0; nk.values_offset = -1; - memset(nk.unk3, 0, 5); + memset(nk.unk3, 0, 5 * sizeof(uint32_t)); nk.clsname_offset = -1; nk.clsname_length = 0; nk.sk_offset = 0x80; |