From 2e1ac4bbf5b5a52bda106841be2e2ce3a5e3880c Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 16 Jul 2024 10:33:38 +0200 Subject: [PATCH] s4:torture: Initialize pointer with NULL "Error: UNINIT (CWE-457): samba-4.20.0rc2/source4/torture/smb2/durable_open.c:1447: var_decl: Declaring variable ""tree2"" without initializer. samba-4.20.0rc2/source4/torture/smb2/durable_open.c:1492: uninit_use_in_call: Using uninitialized value ""tree2"" when calling ""smb2_util_unlink"". 1490| } 1491| 1492|-> smb2_util_unlink(tree2, fname); 1493| 1494| talloc_free(tree);" Signed-off-by: Andreas Schneider Reviewed-by: Alexander Bokovoy --- source4/torture/smb2/durable_open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c index e4513cf4155..cd07b330484 100644 --- a/source4/torture/smb2/durable_open.c +++ b/source4/torture/smb2/durable_open.c @@ -1444,7 +1444,7 @@ static bool test_durable_open_reopen3(struct torture_context *tctx, struct smb2_handle *h = NULL; struct smb2_create io1, io2; bool ret = true; - struct smb2_tree *tree2; + struct smb2_tree *tree2 = NULL; /* Choose a random name in case the state is left a little funky. */ snprintf(fname, 256, "durable_open_reopen3_%s.dat", -- 2.47.3