changeset 20946:a3acbf6f9b14

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
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 24 Oct 2016 12:25:48 +0300
parents 196d7ea73bc6
children 7378fdc4b94a
files src/lib-index/mail-cache-lookup.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache-lookup.c	Mon Oct 24 12:23:49 2016 +0300
+++ b/src/lib-index/mail-cache-lookup.c	Mon Oct 24 12:25:48 2016 +0300
@@ -199,7 +199,7 @@
 				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 */