From 4be88b68cc451b65f2fb28908c9411ecc7d205ad Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Wed, 10 Jul 2013 15:04:56 +0200 Subject: [PATCH] csync: Fix possible null pointer dereferences in tree walkers. CID: 1032801 CID: 1032804 Reviewed-by: Andreas Schneider --- src/csync.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/csync.c b/src/csync.c index a68a3954c..9ed8d3b8d 100644 --- a/src/csync.c +++ b/src/csync.c @@ -624,9 +624,9 @@ int csync_walk_remote_tree(CSYNC *ctx, csync_treewalk_visit_func *visitor, int { c_rbtree_t *tree = NULL; - ctx->status_code = CSYNC_STATUS_OK; + if (ctx != NULL) { + ctx->status_code = CSYNC_STATUS_OK; - if( ctx ) { tree = ctx->remote.tree; } return _csync_walk_tree(ctx, tree, visitor, filter); @@ -639,9 +639,9 @@ int csync_walk_local_tree(CSYNC *ctx, csync_treewalk_visit_func *visitor, int fi { c_rbtree_t *tree = NULL; - ctx->status_code = CSYNC_STATUS_OK; + if (ctx != NULL) { + ctx->status_code = CSYNC_STATUS_OK; - if( ctx ) { tree = ctx->local.tree; } return _csync_walk_tree(ctx, tree, visitor, filter);