]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: mail_index_transaction_get_highest_modseq() - Fix handling MAIL_INDEX_MAIL...
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 22 Jul 2021 12:28:39 +0000 (15:28 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 9 Aug 2021 15:53:56 +0000 (15:53 +0000)
MAIL_INDEX_MAIL_FLAG_UPDATE_MODSEQ flag updates didn't calculate the
returned modseq correctly. This function wasn't used outside
--with-devel-checks though, but with it this fixes:

Panic: file mail-index-transaction.c: line 212 (mail_index_transaction_commit_real): assertion failed: (t->reset || expected_highest_modseq == log->head->sync_highest_modseq)

src/lib-index/mail-index-transaction-export.c

index 87b5006f4d145ef0d82760659e0b97d01b907c9f..e944edd2058b2794fc7d90a1d76c4e5e40519662 100644 (file)
@@ -579,7 +579,7 @@ transaction_flag_updates_have_non_internal(struct mail_index_transaction *t)
        }
 
        array_foreach(&t->updates, u) {
-               uint8_t changed_flags = u->add_flags | u->remove_flags;
+               uint16_t changed_flags = u->add_flags | u->remove_flags;
 
                if ((changed_flags & ~internal_flags) != 0)
                        return TRUE;