[dovecot-cvs] dovecot/src/lib-index mailbox-list-index.c,1.5,1.6

tss at dovecot.org tss at dovecot.org
Thu Mar 15 03:52:51 EET 2007


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv30848

Modified Files:
	mailbox-list-index.c 
Log Message:
Error handling fixes



Index: mailbox-list-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mailbox-list-index.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mailbox-list-index.c	15 Mar 2007 01:34:44 -0000	1.5
+++ mailbox-list-index.c	15 Mar 2007 01:52:49 -0000	1.6
@@ -118,11 +118,17 @@
 	if (hdr->next_uid == 0)
 		return mailbox_list_index_set_corrupted(index, "next_uid is 0");
 
+	if (index->mail_index->hdr == NULL) {
+		/* index already marked as corrupted */
+		return -1;
+	}
+
 	if (hdr->uid_validity != index->mail_index->hdr->uid_validity &&
 	    index->mail_index->hdr->uid_validity != 0) {
 		mail_index_set_error(index->mail_index,
 			"uid_validity changed in file %s", index->filepath);
 		mail_index_mark_corrupted(index->mail_index);
+		return -1;
 	}
 
 	return 0;



More information about the dovecot-cvs mailing list