]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict-extra: dict-fs - Fix endless loop while iterating
authorManuel Mausz <manuel@mausz.at>
Tue, 26 Jul 2022 08:07:31 +0000 (10:07 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 22 Sep 2023 12:15:04 +0000 (12:15 +0000)
Broken by 32e8bd5b5a9d5bc04e5ac6c65ac132ba5c386d64

src/lib-dict-extra/dict-fs.c

index 1ff662e8914f5aa25f99a5abc1833827aea72859..99f9511a621391ec3482228a6553c6b362dc9411 100644 (file)
@@ -174,7 +174,6 @@ static bool fs_dict_iterate(struct dict_iterate_context *ctx,
 {
        struct fs_dict_iterate_context *iter =
                (struct fs_dict_iterate_context *)ctx;
-       struct fs_dict *dict = (struct fs_dict *)ctx->dict;
        const char *path, *error;
        int ret;
 
@@ -182,17 +181,9 @@ static bool fs_dict_iterate(struct dict_iterate_context *ctx,
                return FALSE;
 
        *key_r = fs_iter_next(iter->fs_iter);
-       if (*key_r == NULL) {
-               if (fs_iter_deinit(&iter->fs_iter, &error) < 0) {
-                       iter->error = i_strdup(error);
-                       return FALSE;
-               }
-               if (iter->path == NULL)
-                       return FALSE;
-               path = fs_dict_get_full_key(ctx->set.username, iter->path);
-               iter->fs_iter = fs_iter_init(dict->fs, path, 0);
-               return fs_dict_iterate(ctx, key_r, values_r);
-       }
+       if (*key_r == NULL)
+               return FALSE;
+
        path = t_strconcat(iter->path, *key_r, NULL);
        if ((iter->flags & DICT_ITERATE_FLAG_NO_VALUE) != 0) {
                *key_r = path;