]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 11 Nov 2016 15:02:05 +0000 (17:02 +0200)
If dict_iterate_has_more() keeps returning TRUE, the caller keeps calling
dict_iterate().

src/lib-dict/dict.c

index 92d5570883fe21c1144fbb0b57a178d2c87fd2f9..142ac946450ab1290b583fae38b607fff6e6431b 100644 (file)
@@ -179,6 +179,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))