From: Jeremy Allison Date: Tue, 3 Oct 2017 00:36:51 +0000 (-0700) Subject: s3: VFS: Ensure default SMB_VFS_GETWD() call can't return a partially completed struc... X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=b07f22158d7feaf9146b68a874427efe0538dbb6;p=metze%2Fsamba%2Fwip.git s3: VFS: Ensure default SMB_VFS_GETWD() call can't return a partially completed struct smb_filename. 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 --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 0a56e457ab92..53d97859ec3a 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,