dovecot-1.1: Avoid assert-crashing with broken transaction log f...

dovecot at dovecot.org dovecot at dovecot.org
Sun May 25 04:19:53 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/2c3bb09045be
changeset: 7545:2c3bb09045be
user:      Timo Sirainen <tss at iki.fi>
date:      Sun May 25 04:17:39 2008 +0300
description:
Avoid assert-crashing with broken transaction log files.

diffstat:

1 file changed, 10 insertions(+)
src/lib-index/mail-transaction-log-view.c |   10 ++++++++++

diffs (20 lines):

diff -r 7512b6d8afe1 -r 2c3bb09045be src/lib-index/mail-transaction-log-view.c
--- a/src/lib-index/mail-transaction-log-view.c	Sun May 25 03:11:15 2008 +0300
+++ b/src/lib-index/mail-transaction-log-view.c	Sun May 25 04:17:39 2008 +0300
@@ -146,6 +146,16 @@ int mail_transaction_log_view_set(struct
 			"file_seq=%u, min_file_offset (%"PRIuUOFF_T
 			") > max_file_offset (%"PRIuUOFF_T")",
 			min_file_seq, min_file_offset, max_file_offset);
+		return -1;
+	}
+
+	if (min_file_offset > 0 && min_file_offset < view->tail->hdr.hdr_size) {
+		/* log file offset is probably corrupted in the index file. */
+		mail_transaction_log_view_set_corrupted(view,
+			"file_seq=%u, min_file_offset (%"PRIuUOFF_T
+			") < hdr_size (%u)",
+			min_file_seq, min_file_offset,
+			view->tail->hdr.hdr_size);
 		return -1;
 	}
 


More information about the dovecot-cvs mailing list