From 09d731470e1cb5e0ea24a0a3e3daaa869daf3c93 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 24 Jun 2024 10:11:31 +0200 Subject: [PATCH] s4:torture: Initialize struct smb2_handle "Error: UNINIT (CWE-457): samba-4.20.0rc2/source4/torture/smb2/lease.c:336: var_decl: Declaring variable ""hnew"" without initializer. samba-4.20.0rc2/source4/torture/smb2/lease.c:377: uninit_use_in_call: Using uninitialized value ""hnew"" when calling ""smb2_util_close"". 375| done: 376| smb2_util_close(tree, h); 377|-> smb2_util_close(tree, hnew); 378| 379| smb2_util_unlink(tree, fname);" Signed-off-by: Andreas Schneider Reviewed-by: Noel Power --- source4/torture/smb2/lease.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source4/torture/smb2/lease.c b/source4/torture/smb2/lease.c index 30bbefdce6a..60c79e7666b 100644 --- a/source4/torture/smb2/lease.c +++ b/source4/torture/smb2/lease.c @@ -333,7 +333,12 @@ static bool test_lease_upgrade2(struct torture_context *tctx, struct smb2_tree *tree) { TALLOC_CTX *mem_ctx = talloc_new(tctx); - struct smb2_handle h, hnew; + struct smb2_handle h = { + .data = {}, + }; + struct smb2_handle hnew = { + .data = {}, + }; NTSTATUS status; struct smb2_create io; struct smb2_lease ls;