[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-file.c, 1.5, 1.6

cras at dovecot.org cras at dovecot.org
Sun Oct 3 15:32:03 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv17397/lib-storage/index/mbox

Modified Files:
	mbox-file.c 
Log Message:
Give error message instead of crashing if mbox offset is lost.



Index: mbox-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-file.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mbox-file.c	26 Sep 2004 14:15:56 -0000	1.5
+++ mbox-file.c	3 Oct 2004 12:32:01 -0000	1.6
@@ -108,6 +108,14 @@
 		return -1;
 	}
 
+	if (data == NULL) {
+		mail_storage_set_critical(ibox->box.storage,
+			"Cached message offset lost for seq %u in mbox file %s",
+			seq, ibox->path);
+		mail_index_mark_corrupted(ibox->index);
+		return -1;
+	}
+
 	offset = *((const uint64_t *)data);
 	if (istream_raw_mbox_seek(ibox->mbox_stream, offset) < 0) {
 		if (offset == 0) {



More information about the dovecot-cvs mailing list