From: Timo Sirainen Date: Mon, 24 Oct 2016 09:25:48 +0000 (+0300) Subject: lib-index: Fix potential assert-crash when reading cache X-Git-Tag: 2.2.26~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d0a2dd56e41248e9cf497c21aeedd123fd6646e0;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Fix potential assert-crash when reading cache Fixes: Panic: file mail-cache-lookup.c: line 258 (mail_cache_lookup_iter_next): assertion failed: (ctx->offset != 0) Broken by d33fc6c584718efd46159e1d8f46488b9dfc66f5 --- diff --git a/src/lib-index/mail-cache-lookup.c b/src/lib-index/mail-cache-lookup.c index 0f83198dc2..5acc59f97b 100644 --- a/src/lib-index/mail-cache-lookup.c +++ b/src/lib-index/mail-cache-lookup.c @@ -199,7 +199,7 @@ mail_cache_lookup_iter_next_record(struct mail_cache_lookup_iterate_ctx *ctx) return 1; ctx->memory_appends_checked = TRUE; } - if (MAIL_CACHE_IS_UNUSABLE(view->cache)) + if (MAIL_CACHE_IS_UNUSABLE(view->cache) || ctx->stop) return 0; /* check data already written to cache file */