[dovecot-cvs] dovecot/src/lib-index mail-index.c,1.243,1.244

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


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

Modified Files:
	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.243
retrieving revision 1.244
diff -u -d -r1.243 -r1.244
--- mail-index.c	13 Oct 2006 18:42:50 -0000	1.243
+++ mail-index.c	7 Nov 2006 21:33:51 -0000	1.244
@@ -560,6 +560,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