From: Timo Sirainen Date: Fri, 9 Jun 2017 11:31:15 +0000 (+0300) Subject: lib-storage: Fix setting the correct cache record corrupted X-Git-Tag: 2.3.0.rc1~1470 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a5fe0c06f48b202a5f1d3dd49f7ed7ed92d64ae;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Fix setting the correct cache record corrupted It was mixing UIDs and sequences, so a wrong mail could have been set corrupted or it could have crashed with: Panic: file mail-index-transaction-update.c: line 1018 (mail_index_update_ext): assertion failed: (seq > 0 && (seq <= mail_index_view_get_messages_count(t->view) || seq <= t->last_new_seq)) --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 067a65bc14..2405161e05 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -2754,7 +2754,7 @@ void mail_set_mail_cache_corrupted(struct mail *mail, const char *fmt, ...) va_start(va, fmt); T_BEGIN { - mail_cache_set_seq_corrupted_reason(cache_view, mail->uid, + mail_cache_set_seq_corrupted_reason(cache_view, mail->seq, t_strdup_printf("UID %u: %s", mail->uid, t_strdup_vprintf(fmt, va)));