From ae4a7e6f1b097004f2bb62dd43f14db3f78ada0f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 23 Jun 2004 16:43:36 +0300 Subject: [PATCH] Crashfixes for disabled cache. --HG-- branch : HEAD --- src/lib-index/mail-cache-lookup.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib-index/mail-cache-lookup.c b/src/lib-index/mail-cache-lookup.c index c28ccedc49..f1aebc164a 100644 --- a/src/lib-index/mail-cache-lookup.c +++ b/src/lib-index/mail-cache-lookup.c @@ -13,6 +13,9 @@ mail_cache_get_header_fields_str(struct mail_cache *cache, unsigned int idx) uint32_t offset, data_size; unsigned char *buf; + if (cache->disabled) + return NULL; + offset = mail_cache_offset_to_uint32(cache->hdr->header_offsets[idx]); if (offset == 0) @@ -90,6 +93,9 @@ const char *const *mail_cache_get_header_fields(struct mail_cache_view *view, i_assert(idx < MAIL_CACHE_HEADERS_COUNT); + if (view->cache->disabled) + return NULL; + /* t_strsplit() is a bit slow, so we cache it */ if (cache->hdr->header_offsets[idx] != cache->split_offsets[idx]) { p_clear(cache->split_header_pool); -- 2.47.3