]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict: Fix infinite loop when row limit is reached.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 10 Nov 2016 20:57:22 +0000 (22:57 +0200)
committerGitLab <gitlab@git.dovecot.net>
Fri, 11 Nov 2016 12:03:41 +0000 (14:03 +0200)
If dict_iterate_has_more() keeps returning TRUE, the caller keeps calling
dict_iterate().

src/lib-dict/dict.c

index 92bcdda2dccfcbfbb08fccf9e88b256aca6ae826..903bbb04583f4d6ff6063fa26dddc80a9d29ba38 100644 (file)
@@ -171,6 +171,7 @@ bool dict_iterate(struct dict_iterate_context *ctx,
                return FALSE;
        if (ctx->max_rows > 0 && ctx->row_count >= ctx->max_rows) {
                /* row count was limited */
+               ctx->has_more = FALSE;
                return FALSE;
        }
        if (!ctx->dict->v.iterate(ctx, key_r, value_r))