From: Andreas Schneider Date: Mon, 8 Jul 2024 09:05:45 +0000 (+0200) Subject: s4:torture: Initialize struct smb2_create X-Git-Tag: tdb-1.4.11~131 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d003a171912a33c0fb49b90dae4bc8e1979019de;p=thirdparty%2Fsamba.git 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 --- 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;