From 6901e5fc1cf01f6a1d46a75339cb7208ee712d55 Mon Sep 17 00:00:00 2001 From: Ted Phelps Date: Sat, 2 Sep 2023 17:50:55 +1000 Subject: [PATCH] dsync: Fix an infinite loop Be sure to update 'name' when traversing the components of a path in convert_name_to_remote_sep. Otherwise we end up allocating a lot of memory and failing. --- src/doveadm/dsync/dsync-mailbox-tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/doveadm/dsync/dsync-mailbox-tree.c b/src/doveadm/dsync/dsync-mailbox-tree.c index 941ddbb221..baf0fb86ff 100644 --- a/src/doveadm/dsync/dsync-mailbox-tree.c +++ b/src/doveadm/dsync/dsync-mailbox-tree.c @@ -268,6 +268,7 @@ convert_name_to_remote_sep(struct dsync_mailbox_tree *tree, const char *name) const char *end = strchr(name, tree->sep); const char *name_part = end == NULL ? name : t_strdup_until(name, end++); + name = end; if (tree->escape_char != '\0') mailbox_list_name_unescape(&name_part, tree->escape_char); -- 2.47.3