[Pkg-owncloud-commits] [owncloud-client] 14/33: Fix potential crash in case of abort while update:
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu Feb 27 19:44:24 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch upstream
in repository owncloud-client.
commit a71cb1d3efafa04eec45cdaaa6aeab21f0407999
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Fri Feb 21 16:57:24 2014 +0100
Fix potential crash in case of abort while update:
We need to reset ctx->remote.read_from_db BEFORE caling vio_closedir
Otherwise, it may interpret the handle as a 'bdtree' handle instead of
a owncloud handle.
Should fix #1442
---
csync/src/csync_update.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/csync/src/csync_update.c b/csync/src/csync_update.c
index c903371..33f471a 100644
--- a/csync/src/csync_update.c
+++ b/csync/src/csync_update.c
@@ -598,7 +598,6 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
ctx->status_code = CSYNC_STATUS_UPDATE_ERROR;
}
- csync_vio_closedir(ctx, dh);
ctx->current_fs = previous_fs;
goto done;
}
@@ -608,7 +607,6 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
rc = csync_ftw(ctx, filename, fn, depth - 1);
if (rc < 0) {
ctx->current_fs = previous_fs;
- csync_vio_closedir(ctx, dh);
goto done;
}
@@ -637,6 +635,9 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
done:
ctx->remote.read_from_db = read_from_db;
+ if (dh != NULL) {
+ csync_vio_closedir(ctx, dh);
+ }
csync_vio_file_stat_destroy(dirent);
SAFE_FREE(filename);
return rc;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list