From d003a171912a33c0fb49b90dae4bc8e1979019de Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 8 Jul 2024 11:05:45 +0200 Subject: [PATCH] s4:torture: Initialize struct smb2_create "Error: UNINIT (CWE-457): samba-4.20.0rc2/source4/torture/smb2/sharemode.c:639: var_decl: Declaring variable ""cr3"" without initializer. samba-4.20.0rc2/source4/torture/smb2/sharemode.c:736: uninit_use_in_call: Using uninitialized value ""cr3.out.file.handle"" when calling ""smb2_util_close"". 734| smb2_util_close(tree, cr1.out.file.handle); 735| smb2_util_close(tree, cr2.out.file.handle); 736|-> smb2_util_close(tree, cr3.out.file.handle); 737| smb2_util_unlink(tree, fname); 738| return ret;" Signed-off-by: Andreas Schneider Reviewed-by: Guenther Deschner --- source4/torture/smb2/sharemode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source4/torture/smb2/sharemode.c b/source4/torture/smb2/sharemode.c index 97381b56f17..b503378e9c3 100644 --- a/source4/torture/smb2/sharemode.c +++ b/source4/torture/smb2/sharemode.c @@ -634,9 +634,9 @@ static bool test_smb2_bug14375(struct torture_context *tctx, struct smb2_tree *tree) { const char *fname = "test_bug14375"; - struct smb2_create cr1; - struct smb2_create cr2; - struct smb2_create cr3; + struct smb2_create cr1 = {}; + struct smb2_create cr2 = {}; + struct smb2_create cr3 = {}; NTSTATUS status; bool ret = true; -- 2.47.3