[dovecot-cvs] dovecot/src/lib-index mail-index-view.c,1.50,1.51

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


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

Modified Files:
	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.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- mail-index-view.c	17 Sep 2006 18:34:15 -0000	1.50
+++ mail-index-view.c	10 Dec 2006 14:43:21 -0000	1.51
@@ -199,6 +199,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