From 7990a2ba08ca8ce015282aa01f318ae9623e51df Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 24 Jun 2024 12:22:19 +0200 Subject: [PATCH] s4:torture: Initialize struct wrepl_wins_name "Error: UNINIT (CWE-457): samba-4.20.0rc2/source4/torture/nbt/winsreplication.c:6759: var_decl: Declaring variable ""wins_name_"" without initializer. samba-4.20.0rc2/source4/torture/nbt/winsreplication.c:6760: assign: Assigning: ""wins_name"" = ""&wins_name_"", which points to uninitialized data. samba-4.20.0rc2/source4/torture/nbt/winsreplication.c:9455: uninit_use_in_call: Using uninitialized value ""*wins_name"". Field ""wins_name->is_group"" is uninitialized when calling ""test_wrepl_update_one"". 9453| wins_name->unknown = ""255.255.255.255""; 9454| 9455|-> ret &= test_wrepl_update_one(tctx, ctx, &ctx->b, wins_name); 9456| 9457| /*" Signed-off-by: Andreas Schneider Reviewed-by: Noel Power --- source4/torture/nbt/winsreplication.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index 90004cabe63..2bfdb84daed 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -6758,7 +6758,9 @@ static bool test_conflict_owned_active_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_;