smbd/smb2_ioctl: check for NULL dst_fsp before use
authorDavid Disseldorp via samba-technical <samba-technical@lists.samba.org>
Tue, 16 May 2017 12:03:32 +0000 (14:03 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 16 May 2017 23:46:52 +0000 (01:46 +0200)
...not after. CID #1409040.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed May 17 01:46:52 CEST 2017 on sn-devel-144

source3/smbd/smb2_ioctl_filesys.c

index fbff97cc8300aecc9f10787ccc4bcfcb91c26c3f..392372ffecdfd2ac9507fa576c2a0697e03e5029 100644 (file)
@@ -186,16 +186,17 @@ static struct tevent_req *fsctl_dup_extents_send(TALLOC_CTX *mem_ctx,
        if (req == NULL) {
                return NULL;
        }
-       *state = (struct fsctl_dup_extents_state) {
-               .conn = dst_fsp->conn,
-               .ev = ev,
-       };
 
        if (dst_fsp == NULL) {
                tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
                return tevent_req_post(req, ev);
        }
 
+       *state = (struct fsctl_dup_extents_state) {
+               .conn = dst_fsp->conn,
+               .ev = ev,
+       };
+
        if ((dst_fsp->conn->fs_capabilities
                                & FILE_SUPPORTS_BLOCK_REFCOUNTING) == 0) {
                DBG_INFO("FS does not advertise block refcounting support\n");