]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Crashfixes for disabled cache.
authorTimo Sirainen <tss@iki.fi>
Wed, 23 Jun 2004 13:43:36 +0000 (16:43 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 23 Jun 2004 13:43:36 +0000 (16:43 +0300)
--HG--
branch : HEAD

src/lib-index/mail-cache-lookup.c

index c28ccedc494fdc1757e1b9d4bdc9f5aaa059479b..f1aebc164afc8baa83b549919e7611480b365cf0 100644 (file)
@@ -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);