From: Timo Sirainen Date: Thu, 10 Nov 2016 20:57:22 +0000 (+0200) Subject: lib-dict: Fix infinite loop when row limit is reached. X-Git-Tag: 2.3.0.rc1~2656 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea90267d457a03b5b1e0e2a5111949609edb4cb3;p=thirdparty%2Fdovecot%2Fcore.git lib-dict: Fix infinite loop when row limit is reached. If dict_iterate_has_more() keeps returning TRUE, the caller keeps calling dict_iterate(). --- diff --git a/src/lib-dict/dict.c b/src/lib-dict/dict.c index 92bcdda2dc..903bbb0458 100644 --- a/src/lib-dict/dict.c +++ b/src/lib-dict/dict.c @@ -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))