]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 12 Jun 2017 13:15:38 +0000 (16:15 +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 7ad9a1fc51e5a7f4b86e62be716daa8257b52afb..1a8bc36c2956a9ffad96e67df9f6329347039f54 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)));