]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fixed view syncing when changes couldn't be read from transaction logs
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 29 Jun 2016 11:16:58 +0000 (14:16 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 29 Jun 2016 11:18:45 +0000 (14:18 +0300)
Fixes errors like:

Log synchronization error at seq=0,offset=0 for .../dovecot.index: Append with UID 5, but next_uid = 6
.../dovecot.index view syncing failed to apply changes

src/lib-index/mail-index-view-sync.c

index 57214a20541c1788228350dbc03f9d79767eb8ed..cdc2b2b5c6d5f7bb88ab80326f5ef3d5fc6f0818 100644 (file)
@@ -428,7 +428,7 @@ view_sync_get_log_lost_changes(struct mail_index_view_sync_ctx *ctx,
 
        /* handle expunges and sync flags */
        seqi = seqj = 1;
-       while (seqi < old_count && seqj < new_count) {
+       while (seqi <= old_count && seqj <= new_count) {
                old_rec = MAIL_INDEX_REC_AT_SEQ(old_map, seqi);
                new_rec = MAIL_INDEX_REC_AT_SEQ(new_map, seqj);
                if (old_rec->uid == new_rec->uid) {