From: Timo Sirainen Date: Wed, 29 Jun 2016 11:16:58 +0000 (+0300) Subject: lib-index: Fixed view syncing when changes couldn't be read from transaction logs X-Git-Tag: 2.3.0.rc1~3407 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41a6be2852b10158e98934aa7e4922baf887a0c3;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Fixed view syncing when changes couldn't be read from transaction logs 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 --- diff --git a/src/lib-index/mail-index-view-sync.c b/src/lib-index/mail-index-view-sync.c index 57214a2054..cdc2b2b5c6 100644 --- a/src/lib-index/mail-index-view-sync.c +++ b/src/lib-index/mail-index-view-sync.c @@ -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) {