From de9b27a2fca593a7b0f1ff662ef4c4872bb7bf9f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 2 Oct 2017 17:36:51 -0700 Subject: [PATCH] s3: VFS: Ensure default SMB_VFS_GETWD() call can't return a partially completed struct smb_filename. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG: https://bugzilla.samba.org/show_bug.cgi?id=13068 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Wed Oct 4 14:05:33 CEST 2017 on sn-devel-144 (cherry picked from commit b07f22158d7feaf9146b68a874427efe0538dbb6) --- source3/modules/vfs_default.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 0a56e457ab9..53d97859ec3 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -2226,6 +2226,10 @@ static struct smb_filename *vfswrap_getwd(vfs_handle_struct *handle, START_PROFILE(syscall_getwd); result = sys_getwd(); END_PROFILE(syscall_getwd); + + if (result == NULL) { + return NULL; + } smb_fname = synthetic_smb_fname(ctx, result, NULL, -- 2.14.2.920.gcf0c67979c-goog