From: Timo Sirainen Date: Wed, 1 Apr 2020 21:29:07 +0000 (+0300) Subject: lib-index: Make sure purging clears saved bitmask offsets state between mails X-Git-Tag: 2.3.11.2~376 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=021547c4d8211f9168666c482e1d2215b5d4c12c;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Make sure purging clears saved bitmask offsets state between mails This is just to make sure it doesn't try to use previous mail's offset when merging bitmasks. This shouldn't have been possible anyway, because field_seen array guaranteed that the bitmask_pos was always set before reading it. This just makes extra sure of it. --- diff --git a/src/lib-index/mail-cache-compress.c b/src/lib-index/mail-cache-compress.c index b1a358cf84..1ca84ae81f 100644 --- a/src/lib-index/mail-cache-compress.c +++ b/src/lib-index/mail-cache-compress.c @@ -259,6 +259,7 @@ mail_cache_copy(struct mail_cache *cache, struct mail_index_transaction *trans, 0, buffer_get_size(ctx.field_seen)); ctx.field_seen_value++; } + array_clear(&ctx.bitmask_pos); i_zero(&cache_rec); buffer_append(ctx.buffer, &cache_rec, sizeof(cache_rec));