[dovecot-cvs] dovecot/src/lib-index mail-index-view.c, 1.44.2.1, 1.44.2.2

tss at dovecot.org tss at dovecot.org
Sun Dec 10 14:43:21 UTC 2006


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

Modified Files:
      Tag: branch_1_0
	mail-index-view.c 
Log Message:
If looked up record contains UID=0, mark the index corrupted.



Index: mail-index-view.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-view.c,v
retrieving revision 1.44.2.1
retrieving revision 1.44.2.2
diff -u -d -r1.44.2.1 -r1.44.2.2
--- mail-index-view.c	11 Jun 2006 19:01:28 -0000	1.44.2.1
+++ mail-index-view.c	10 Dec 2006 14:43:19 -0000	1.44.2.2
@@ -196,6 +196,12 @@
 
 	/* look up the record */
 	rec = MAIL_INDEX_MAP_IDX(view->map, seq-1);
+	if (rec->uid == 0) {
+		mail_index_set_error(view->index, "Corrupted Index file %s: "
+			"Record [%u].uid=0", view->index->filepath, seq);
+		mail_index_mark_corrupted(view->index);
+		return -1;
+	}
 	if (view->map == view->index->map) {
 		/* view's mapping is latest. we can use it directly. */
 		*map_r = view->map;



More information about the dovecot-cvs mailing list