From 57001527ae6209ec907d37e8b96a2e545cfe632e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 21 Jun 2024 10:45:23 +0200 Subject: [PATCH] s4:torture: Initialize pointers "Error: UNINIT (CWE-457): samba-4.20.0rc2/source4/torture/smb2/durable_open.c:1518: var_decl: Declaring variable ""tree2"" without initializer. samba-4.20.0rc2/source4/torture/smb2/durable_open.c:1584: uninit_use_in_call: Using uninitialized value ""tree2"" when calling ""smb2_util_close"". 1582| if (tree != NULL) { 1583| if (h != NULL) { 1584|-> smb2_util_close(tree2, *h); 1585| } 1586|" Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke --- source4/torture/smb2/durable_open.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c index f56c55811ac..e4513cf4155 100644 --- a/source4/torture/smb2/durable_open.c +++ b/source4/torture/smb2/durable_open.c @@ -1513,9 +1513,9 @@ static bool test_durable_open_reopen4(struct torture_context *tctx, struct smb2_handle *h = NULL; struct smb2_create io1, io2; bool ret = true; - struct smb2_transport *transport; - struct smb2_session *session2; - struct smb2_tree *tree2; + struct smb2_transport *transport = NULL; + struct smb2_session *session2 = NULL; + struct smb2_tree *tree2 = NULL; /* Choose a random name in case the state is left a little funky. */ snprintf(fname, 256, "durable_open_reopen4_%s.dat", @@ -2048,7 +2048,7 @@ static bool test_durable_open_lease(struct torture_context *tctx, * Windows7 (build 7000) will grant an RH lease immediate (not an RHW?) * even if the original client is gone. (ZML: This seems like a bug. It * should give some time for the client to reconnect! And why RH?) - * + * * obnox: Current windows 7 and w2k8r2 grant RHW instead of RH. * Test is adapted accordingly. */ -- 2.47.3