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.2.27~184 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0640d222b735d6ad13408b824ebcabf6b8d23f76;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 92d5570883..142ac94645 100644 --- a/src/lib-dict/dict.c +++ b/src/lib-dict/dict.c @@ -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))