From 40d1498fc3cdf73d10f7a318c946f74706f58b1c Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Wed, 10 Jul 2013 15:17:26 +0200 Subject: [PATCH] owncloud: Fix possible NULL pointer dereferences. CID: #996808 Reviewed-by: Andreas Schneider --- modules/csync_owncloud.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/csync_owncloud.c b/modules/csync_owncloud.c index 041047fd8..6284325d6 100644 --- a/modules/csync_owncloud.c +++ b/modules/csync_owncloud.c @@ -1384,14 +1384,12 @@ static csync_vio_file_stat_t *owncloud_readdir(csync_vio_method_handle_t *dhandl struct listdir_context *fetchCtx = dhandle; csync_vio_file_stat_t *lfs = NULL; - if( fetchCtx->currResource ) { - // DEBUG_WEBDAV("readdir method called for %s, fetchCtx->currResource->uri); - } else { + if( fetchCtx == NULL) { /* DEBUG_WEBDAV("An empty dir or at end); */ return NULL; } - if( fetchCtx && fetchCtx->currResource ) { + if( fetchCtx->currResource ) { /* FIXME: Who frees the allocated mem for lfs, allocated in the helper func? */ lfs = resourceToFileStat( fetchCtx->currResource );