From: Timo Sirainen Date: Mon, 10 May 2004 21:26:31 +0000 (+0300) Subject: don't crash with assert if transacton log has expunge with seq 0 X-Git-Tag: 1.1.alpha1~4095 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f22fc1d063d48ed368b4cb124b44183bc27773c;p=thirdparty%2Fdovecot%2Fcore.git don't crash with assert if transacton log has expunge with seq 0 --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-index-sync.c b/src/lib-index/mail-index-sync.c index 3fdbbb37bf..0cfe72851d 100644 --- a/src/lib-index/mail-index-sync.c +++ b/src/lib-index/mail-index-sync.c @@ -307,15 +307,9 @@ int mail_index_sync_next(struct mail_index_sync_ctx *ctx, it's quite unlikely this expunge was caused by some bug. */ uint32_t uid1, uid2; - if (next_exp->seq1 > ctx->view->map->records_count || - next_exp->seq2 > ctx->view->map->records_count) { - mail_transaction_log_view_set_corrupted( - ctx->view->log_view, "Expunge range %u..%u " - "larger than message count %u", - next_exp->seq1, next_exp->seq2, - ctx->view->map->records_count); + mail_index_sync_get_expunge(sync_rec, next_exp); + if (mail_index_sync_rec_check(ctx->view, sync_rec) < 0) return -1; - } if (mail_index_lookup_uid(ctx->view, next_exp->seq1, &uid1) < 0) return -1; @@ -330,13 +324,12 @@ int mail_index_sync_next(struct mail_index_sync_ctx *ctx, return -1; } - mail_index_sync_get_expunge(sync_rec, next_exp); ctx->expunge_idx++; /* scan updates again from the beginning */ ctx->update_idx = 0; ctx->next_seq = next_exp->seq2; - return mail_index_sync_rec_check(ctx->view, sync_rec); + return 1; } if (ctx->sync_appends) {