]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Fix an infinite loop
authorTed Phelps <phelps@gnusto.com>
Sat, 2 Sep 2023 07:50:55 +0000 (17:50 +1000)
committerDovecot Automation <automation@dovecot.org>
Mon, 4 Sep 2023 11:34:23 +0000 (11:34 +0000)
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

index 941ddbb22179862a1fd1d37b1632bd23290f351b..baf0fb86ffe9475ac783e878511aefcf4c5d5409 100644 (file)
@@ -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);