summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2016-11-30 14:19:39 +1300
committerRalph Boehme <slow@samba.org>2016-11-30 20:36:24 +0100
commit28eb49c7ede1c530f4c27fb4c136e88fd6ba7f93 (patch)
treeea6484a902b5e5f7f8eb5914df621f6e528a9f2a /source4/lib
parentf5154a86fab60b572f0b77017508a940c55d49e4 (diff)
downloadsamba-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.c2
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;