From: Timo Sirainen Date: Sat, 2 Nov 2013 11:14:16 +0000 (+0200) Subject: mbox: Added assert to try to catch corruption. X-Git-Tag: 2.2.7~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c3e771be4a70733276e37185ef1c1ae5f3030734;p=thirdparty%2Fdovecot%2Fcore.git mbox: Added assert to try to catch corruption. --- diff --git a/src/lib-storage/index/mbox/mbox-sync.c b/src/lib-storage/index/mbox/mbox-sync.c index 744098c148..b938e912b4 100644 --- a/src/lib-storage/index/mbox/mbox-sync.c +++ b/src/lib-storage/index/mbox/mbox-sync.c @@ -651,6 +651,8 @@ static int mbox_sync_handle_header(struct mbox_sync_mail_context *mail_ctx) /* read the From-line before rewriting overwrites it */ if (mbox_read_from_line(mail_ctx) < 0) return -1; + i_assert(mail_ctx->mail.from_offset + move_diff != 1 && + mail_ctx->mail.from_offset + move_diff != 2); mbox_sync_update_header(mail_ctx); ret = mbox_sync_try_rewrite(mail_ctx, move_diff);