]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: Initialize struct wrepl_wins_name
authorAndreas Schneider <asn@samba.org>
Wed, 19 Jun 2024 09:21:12 +0000 (11:21 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 24 Jun 2024 06:14:36 +0000 (06:14 +0000)
Found by Covscan.

"Error: UNINIT (CWE-457):
samba-4.20.0rc2/source4/torture/nbt/winsreplication.c:5040: var_decl: Declaring variable ""wins_name_"" without initializer.
samba-4.20.0rc2/source4/torture/nbt/winsreplication.c:5041: assign: Assigning: ""wins_name"" = ""&wins_name_"", which points to uninitialized data.
samba-4.20.0rc2/source4/torture/nbt/winsreplication.c:6680: uninit_use_in_call: Using uninitialized value ""*wins_name"". Field ""wins_name->is_group"" is uninitialized when calling ""test_wrepl_update_one"".
 6678|    wins_name->unknown = ""255.255.255.255"";
 6679|
 6680|->  ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name);
 6681|    ret &= test_wrepl_is_applied(tctx, ctx, &ctx->b, wins_name, true);
 6682|    } else {"

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
source4/torture/nbt/winsreplication.c

index 75499daef47239e370071d72d56415a2b145afd4..90004cabe63614da94d2f005fd198025eecf89f8 100644 (file)
@@ -5037,7 +5037,9 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx
 {
        bool ret = true;
        NTSTATUS status;
-       struct wrepl_wins_name wins_name_;
+       struct wrepl_wins_name wins_name_ = {
+               .flags = 0,
+       };
        struct wrepl_wins_name *wins_name = &wins_name_;
        struct nbt_name_register name_register_;
        struct nbt_name_register *name_register = &name_register_;