]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: Initialize struct smb2_create
authorAndreas Schneider <asn@samba.org>
Mon, 8 Jul 2024 09:05:45 +0000 (11:05 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 16 Jul 2024 11:41:33 +0000 (11:41 +0000)
"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 <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/torture/smb2/sharemode.c

index 97381b56f17fe17866ceeb6840636c8a7fe727ab..b503378e9c382a3be51066d21742816d4ec38bb5 100644 (file)
@@ -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;