]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: handle synthetic_smb_fname failure properly in delete_all_streams
authorShachar Sharon <ssharon@redhat.com>
Thu, 16 Apr 2026 09:04:25 +0000 (12:04 +0300)
committerAnoop C S <anoopcs@samba.org>
Thu, 16 Apr 2026 13:48:23 +0000 (13:48 +0000)
When 'synthetic_smb_fname' fails due to memory error, it returns NULL.
Fix this error-case logic in 'delete_all_streams'.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Apr 16 13:48:23 UTC 2026 on atb-devel-224

source3/smbd/close.c

index 3ce7403c52d370c543b0a6cc77491b1770d615a1..8eb3bd47aebf5fc4a46ae2c0e164ef7535082a69 100644 (file)
@@ -201,7 +201,7 @@ NTSTATUS delete_all_streams(struct files_struct *fsp,
                        NULL,
                        smb_fname->twrp,
                        (smb_fname->flags & ~SMB_FILENAME_POSIX_PATH));
-               if (!NT_STATUS_IS_OK(status)) {
+               if (smb_fname_stream == NULL) {
                        DEBUG(0, ("talloc_aprintf failed\n"));
                        status = NT_STATUS_NO_MEMORY;
                        goto fail;