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

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 <asn@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
This commit is contained in:
Andreas Schneider 2024-06-21 10:45:23 +02:00 committed by Martin Schwenke
parent 1d38f6ee92
commit 57001527ae

View File

@ -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.
*/