changeset 4895:95594bcf13ab HEAD

If looked up record contains UID=0, mark the index corrupted.
author Timo Sirainen <tss@iki.fi>
date Sun, 10 Dec 2006 16:43:21 +0200
parents 24afafbfe47b
children 3d00a9636393
files src/lib-index/mail-index-view.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-view.c	Sun Dec 10 15:00:44 2006 +0200
+++ b/src/lib-index/mail-index-view.c	Sun Dec 10 16:43:21 2006 +0200
@@ -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;