CID 1416475: possibly dereferencing NULL in fruit_pread_meta
authorSwen Schillig <swen@vnet.ibm.com>
Fri, 25 May 2018 10:45:35 +0000 (12:45 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 13 Jun 2018 14:29:48 +0000 (16:29 +0200)
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Jun 13 16:29:48 CEST 2018 on sn-devel-144

source3/modules/vfs_fruit.c

index b1384c478505f82cb6c9522e9ce3b7eb21170996..078426290a41ac7558abda26f20aa1b81f6b4d9e 100644 (file)
@@ -4002,6 +4002,11 @@ static ssize_t fruit_pread_meta(vfs_handle_struct *handle,
                return 0;
        }
 
+       if (fio == NULL) {
+               DBG_ERR("Failed to fetch fsp extension");
+               return -1;
+       }
+
        /* Yes, macOS always reads from offset 0 */
        offset = 0;
        to_return = MIN(n, AFP_INFO_SIZE);