From c0e4818d68cbc6aea50f0e5a56af29407763bab5 Mon Sep 17 00:00:00 2001 From: Swen Schillig Date: Fri, 25 May 2018 11:32:38 +0200 Subject: [PATCH] CID 1416478: de-ref NULL value in fruit_pwrite_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 df3cd0c899e..956739dd5af 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -4405,6 +4405,11 @@ static ssize_t fruit_pwrite_rsrc(vfs_handle_struct *handle, struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp); ssize_t nwritten; + if (fio == NULL) { + DBG_ERR("Failed to fetch fsp extension"); + return -1; + } + switch (fio->config->rsrc) { case FRUIT_RSRC_STREAM: nwritten = fruit_pwrite_rsrc_stream(handle, fsp, data, n, offset);