1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s4:torture: Initialize struct smb2_handle

"Error: UNINIT (CWE-457):
samba-4.20.0rc2/source4/torture/smb2/lease.c:452: var_decl: Declaring variable ""h"" without initializer.
samba-4.20.0rc2/source4/torture/smb2/lease.c:516: uninit_use_in_call: Using uninitialized value ""h"" when calling ""smb2_util_close"".
  514|
  515|    done:
  516|-> 	smb2_util_close(tree, h);
  517|   	smb2_util_close(tree, hnew);
  518|   	smb2_util_close(tree, h2);"

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
This commit is contained in:
Andreas Schneider 2024-06-20 14:48:29 +02:00 committed by Martin Schwenke
parent b6d66e55ad
commit 1d38f6ee92

View File

@ -454,7 +454,15 @@ static bool test_lease_upgrade3(struct torture_context *tctx,
struct smb2_tree *tree) struct smb2_tree *tree)
{ {
TALLOC_CTX *mem_ctx = talloc_new(tctx); TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_handle h, h2, hnew; struct smb2_handle h = {
.data = {0},
};
struct smb2_handle h2 = {
.data = {0},
};
struct smb2_handle hnew = {
.data = {0},
};
NTSTATUS status; NTSTATUS status;
struct smb2_create io; struct smb2_create io;
struct smb2_lease ls; struct smb2_lease ls;