From 80737a126f2b46696e113cd365d34163b51df549 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 24 Oct 2019 14:08:01 +0300 Subject: [PATCH] lib-index: Fix potential assert-crash when cache compression merges bitmasks Fixes: Panic: file array.c: line 10 (array_idx_modifiable_i): assertion failed: (idx < array->buffer->used / array->element_size) (although this panic could happen in other ways as well) --- src/lib-index/mail-cache-compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib-index/mail-cache-compress.c b/src/lib-index/mail-cache-compress.c index c27d188288..3a648db1e7 100644 --- a/src/lib-index/mail-cache-compress.c +++ b/src/lib-index/mail-cache-compress.c @@ -35,7 +35,7 @@ mail_cache_merge_bitmask(struct mail_cache_copy_context *ctx, unsigned char *dest; unsigned int i, *pos; - pos = array_idx_modifiable(&ctx->bitmask_pos, field->field_idx); + pos = array_idx_get_space(&ctx->bitmask_pos, field->field_idx); if (*pos == 0) { /* we decided to drop this field */ return; -- 2.47.3