From: Timo Sirainen Date: Wed, 23 Jun 2004 13:43:36 +0000 (+0300) Subject: Crashfixes for disabled cache. X-Git-Tag: 1.1.alpha1~3877 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae4a7e6f1b097004f2bb62dd43f14db3f78ada0f;p=thirdparty%2Fdovecot%2Fcore.git Crashfixes for disabled cache. --HG-- branch : HEAD --- 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);