From 9715e55e6554c611d858647875d6260c304b5c3a Mon Sep 17 00:00:00 2001 From: Swen Schillig Date: Fri, 25 May 2018 12:43:42 +0200 Subject: [PATCH] CID 1416476: possibly dereferencing NULL in fruit_ftruncate_rsrc Signed-off-by: Swen Schillig Reviewed-by: Christof Schmitt Reviewed-by: Ralph Boehme --- source3/modules/vfs_fruit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index ec49e24817d..b1384c47850 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -5501,6 +5501,11 @@ static int fruit_ftruncate_rsrc(struct vfs_handle_struct *handle, struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp); int ret; + if (fio == NULL) { + DBG_ERR("Failed to fetch fsp extension"); + return -1; + } + switch (fio->config->rsrc) { case FRUIT_RSRC_XATTR: ret = fruit_ftruncate_rsrc_xattr(handle, fsp, offset); -- 2.11.4.GIT