1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

s4:torture: Initialize struct wrepl_wins_name

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>
This commit is contained in:
Andreas Schneider 2024-06-19 11:21:12 +02:00 committed by Andreas Schneider
parent 5d568f6e61
commit 94c06dd189

View File

@ -5037,7 +5037,9 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx
{ {
bool ret = true; bool ret = true;
NTSTATUS status; 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 wrepl_wins_name *wins_name = &wins_name_;
struct nbt_name_register name_register_; struct nbt_name_register name_register_;
struct nbt_name_register *name_register = &name_register_; struct nbt_name_register *name_register = &name_register_;