]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture: Initialize struct smb2_handle
authorAndreas Schneider <asn@samba.org>
Mon, 24 Jun 2024 08:11:31 +0000 (10:11 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 28 Jun 2024 11:39:33 +0000 (11:39 +0000)
"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 <asn@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
source4/torture/smb2/lease.c

index 30bbefdce6a1d0d72bc999cfb0042bd5d8beb4de..60c79e7666b8fb558a6b83791fa193bac9f715ec 100644 (file)
@@ -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;