s3: VFS: Ensure default SMB_VFS_GETWD() call can't return a partially completed struc...
authorJeremy Allison <jra@samba.org>
Tue, 3 Oct 2017 00:36:51 +0000 (17:36 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 4 Oct 2017 12:05:33 +0000 (14:05 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13068

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Oct  4 14:05:33 CEST 2017 on sn-devel-144

source3/modules/vfs_default.c

index 0a56e457ab925102543bef3299b398c26cb7a130..53d97859ec3a695d48db0997bcf218cacf64c1fe 100644 (file)
@@ -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,