# HG changeset patch # User Olaf Wintermann # Date 1550944733 -3600 # Node ID ceed7714846a4c3460edc76d1d6f430b78bc75c0 # Parent 481802342fdf03a073f199f8c5f68ffb45ed273e fixes crash in dav-sync archive command when trying to remove resources from the db diff -r 481802342fdf -r ceed7714846a dav/sync.c --- a/dav/sync.c Mon Feb 04 17:17:48 2019 +0100 +++ b/dav/sync.c Sat Feb 23 18:58:53 2019 +0100 @@ -1191,7 +1191,6 @@ UCX_FOREACH(elm, resources) { LocalResource *local_res = elm->data; - // ignore all files, that are excluded by a static filter (sync.xml) // static include/exclude filter @@ -1245,7 +1244,8 @@ // find all deleted files and cleanup the database UcxMapIterator i = ucx_map_iterator(db->resources); LocalResource *local; - UCX_MAP_FOREACH(key, local, i) { + UcxList *removed_res = NULL; + UCX_MAP_FOREACH(key, local, i) { // all filtered files should be removed from the database if(res_matches_filter(dir, local->path+1)) { ucx_map_cstr_remove(db->resources, local->path); @@ -1266,10 +1266,14 @@ if(!archive) { ls_delete = ucx_list_append(ls_delete, local); } else { - ucx_map_cstr_remove(db->resources, local->path); + removed_res = ucx_list_prepend(removed_res, local); } } } + UCX_FOREACH(elm, removed_res) { + LocalResource *local = elm->data; + ucx_map_cstr_remove(db->resources, local->path); + } ls_delete = ucx_list_sort(ls_delete, (cmp_func)resource_pathlen_cmp, NULL); diff -r 481802342fdf -r ceed7714846a libidav/crypto.c --- a/libidav/crypto.c Mon Feb 04 17:17:48 2019 +0100 +++ b/libidav/crypto.c Sat Feb 23 18:58:53 2019 +0100 @@ -31,7 +31,7 @@ #include #include #include -#include +#include "utils.h" #include "crypto.h"