]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fix setting the correct cache record corrupted
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 9 Jun 2017 11:31:15 +0000 (14:31 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 9 Jun 2017 11:31:15 +0000 (14:31 +0300)
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))

src/lib-storage/mail-storage.c

index 067a65bc14eb3d5a6e5936c7d32ae6ee883d72eb..2405161e0531aae632b79a1db574a65e7fef26f3 100644 (file)
@@ -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)));