Mercurial > dovecot > original-hg > dovecot-1.2
changeset 2910:1a9e4676196d HEAD
Don't crash if cache is unusable.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 29 Nov 2004 02:27:47 +0200 |
parents | f4eaf629bea3 |
children | f2c2b17d7659 |
files | src/lib-index/mail-cache-sync-update.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-cache-sync-update.c Mon Nov 29 02:23:35 2004 +0200 +++ b/src/lib-index/mail-cache-sync-update.c Mon Nov 29 02:27:47 2004 +0200 @@ -77,6 +77,9 @@ if (*cache_offset == 0) return 1; + if (MAIL_CACHE_IS_UNUSABLE(cache)) + return 1; + ret = mail_cache_handler_init(&ctx, cache); *context = ctx; if (ret <= 0) @@ -110,6 +113,9 @@ return 1; } + if (MAIL_CACHE_IS_UNUSABLE(cache)) + return 1; + if (cache->file_cache != NULL) { file_cache_invalidate(cache->file_cache, *new_cache_offset, (size_t)-1);