]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: fake_acls. Add missing NULL check for return of cp_smb_filename().
authorJeremy Allison <jra@samba.org>
Mon, 28 Jun 2021 17:20:49 +0000 (10:20 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 28 Jun 2021 20:03:33 +0000 (20:03 +0000)
Found by Coverity.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jun 28 20:03:33 UTC 2021 on sn-devel-184

source3/modules/vfs_fake_acls.c

index 79735a81233e71f670499b7e3c0bc9b23d6c8951..15cfff63f448a9fa35a6695314a817bac6641341 100644 (file)
@@ -116,6 +116,11 @@ static int fake_acls_stat(vfs_handle_struct *handle,
                         */
                        smb_fname_cp = cp_smb_filename(talloc_tos(),
                                                       smb_fname);
+                       if (smb_fname_cp == NULL) {
+                               errno = ENOMEM;
+                               return -1;
+                       }
+
                        /* Recursion guard. */
                        in_openat_pathref_fsp = true;
                        status = openat_pathref_fsp(handle->conn->cwd_fsp,