From: Ted Phelps Date: Sat, 2 Sep 2023 07:50:55 +0000 (+1000) Subject: dsync: Fix an infinite loop X-Git-Tag: 2.3.21~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6901e5fc1cf01f6a1d46a75339cb7208ee712d55;p=thirdparty%2Fdovecot%2Fcore.git 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. --- 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);