dovecot-2.2: mbox: Added assert to try to catch corruption.

dovecot at dovecot.org dovecot at dovecot.org
Sat Nov 2 13:15:02 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/d3062d066593
changeset: 16907:d3062d066593
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Nov 02 13:14:16 2013 +0200
description:
mbox: Added assert to try to catch corruption.

diffstat:

 src/lib-storage/index/mbox/mbox-sync.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 8eec76bbde28 -r d3062d066593 src/lib-storage/index/mbox/mbox-sync.c
--- a/src/lib-storage/index/mbox/mbox-sync.c	Sat Nov 02 12:46:08 2013 +0200
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Sat Nov 02 13:14:16 2013 +0200
@@ -651,6 +651,8 @@
 		/* 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);


More information about the dovecot-cvs mailing list