[dovecot-cvs] dovecot/src/lib-index mail-index.c, 1.230.2.7, 1.230.2.8

tss at dovecot.org tss at dovecot.org
Tue Nov 7 21:33:43 UTC 2006


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

Modified Files:
      Tag: branch_1_0
	mail-index.c 
Log Message:
When verifying the header, check that next_uid is larger than last message's
UID.



Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.230.2.7
retrieving revision 1.230.2.8
diff -u -d -r1.230.2.7 -r1.230.2.8
--- mail-index.c	13 Oct 2006 18:42:48 -0000	1.230.2.7
+++ mail-index.c	7 Nov 2006 21:33:41 -0000	1.230.2.8
@@ -558,6 +558,15 @@
 	    hdr->first_deleted_uid_lowwater > hdr->next_uid)
 		return 0;
 
+	if (map->records_count > 0) {
+		/* last message's UID must be smaller than next_uid */
+		const struct mail_index_record *rec;
+
+		rec = MAIL_INDEX_MAP_IDX(map, map->records_count-1);
+		if (rec->uid >= hdr->next_uid)
+			return 0;
+	}
+
 	return mail_index_parse_extensions(index, map);
 }
 



More information about the dovecot-cvs mailing list