]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
source3/smbd: Fix NULL dereference in smbXsrv_open_cleanup_fn()
authorAnoop C S <anoopcs@samba.org>
Wed, 13 May 2026 08:37:49 +0000 (14:07 +0530)
committerMartin Schwenke <martins@samba.org>
Thu, 21 May 2026 02:21:29 +0000 (02:21 +0000)
If smbXsrv_open_global_parse_record() fails, global remains NULL. The
do_delete path then attempts to dereference it, causing a crash. Add a
NULL check before accessing global->client_guid and global->create_guid.

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/smbd/smbXsrv_open.c

index c33508fd5259ce56b6f45ea4301534c336b9228f..329332eb56f24abdc76e2283080b4ed55d7269d3 100644 (file)
@@ -1617,8 +1617,10 @@ do_delete:
                  state->global_id,
                  dbwrap_name(dbwrap_record_get_db(rec)));
        state->status = NT_STATUS_OK;
-       state->client_guid = global->client_guid;
-       state->create_guid = global->create_guid;
+       if (global != NULL) {
+               state->client_guid = global->client_guid;
+               state->create_guid = global->create_guid;
+       }
 }
 
 NTSTATUS smbXsrv_open_cleanup(uint64_t persistent_id)