From: Timo Sirainen Date: Mon, 20 Aug 2018 09:51:28 +0000 (+0300) Subject: lib-index: mail_cache_lookup_headers() - Allow using datastack pool X-Git-Tag: 2.3.4~231 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41ecdb63f1b98bdd04838ef0c4371206f81f4269;p=thirdparty%2Fdovecot%2Fcore.git lib-index: mail_cache_lookup_headers() - Allow using datastack pool This fixes assert caused by 53712af0e7f357e7279d9ff03831428aae85aa45: Panic: pool_data_stack_realloc(): stack frame changed --- diff --git a/src/lib-index/mail-cache-lookup.c b/src/lib-index/mail-cache-lookup.c index f070dc0756..f68d17e5d5 100644 --- a/src/lib-index/mail-cache-lookup.c +++ b/src/lib-index/mail-cache-lookup.c @@ -599,16 +599,19 @@ int mail_cache_lookup_headers(struct mail_cache_view *view, string_t *dest, uint32_t seq, unsigned int field_idxs[], unsigned int fields_count) { - pool_t pool; + pool_t pool = NULL; int ret; - T_BEGIN { + if (buffer_get_pool(dest)->datastack_pool) + ret = mail_cache_lookup_headers_real(view, dest, seq, + field_idxs, fields_count, + &pool); + else T_BEGIN { ret = mail_cache_lookup_headers_real(view, dest, seq, field_idxs, fields_count, &pool); - if (pool != NULL) - pool_unref(&pool); } T_END; + pool_unref(&pool); return ret; }