From 3f2a49bb78f9ea3eec2c478909cf22e00233dc54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Filipensk=C3=BD?= Date: Fri, 7 Jan 2022 13:55:38 +0100 Subject: [PATCH] s3:modules: VFS CAP symlinkat always fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG: https://bugzilla.samba.org/show_bug.cgi?id=14941 Found by covscan. Since capnew is initialized by NULL, checking it too early makes the rest of the function a dead code. Pair-programmed-with: Andreas Schneider Signed-off-by: Pavel Filipenský Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison (cherry picked from commit 41ebb7f68c5b21492f503afc4cb341a97654a43d) --- source3/modules/vfs_cap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index 4a47b26c7b9..43c8edb8932 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -448,7 +448,7 @@ static int cap_symlinkat(vfs_handle_struct *handle, int saved_errno = 0; int ret; - if (!capold || !capnew) { + if (capold == NULL) { errno = ENOMEM; return -1; } -- 2.30.2