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

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 <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
Andreas Schneider 2024-07-08 11:05:45 +02:00 committed by Günther Deschner
parent d21b8e057c
commit d003a17191

View 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;