[dovecot-cvs] dovecot/src/lib-index mail-index.c, 1.230.2.17, 1.230.2.18

tss at dovecot.org tss at dovecot.org
Tue Jan 23 11:19:42 UTC 2007


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

Modified Files:
      Tag: branch_1_0
	mail-index.c 
Log Message:
Fix for last check



Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.230.2.17
retrieving revision 1.230.2.18
diff -u -d -r1.230.2.17 -r1.230.2.18
--- mail-index.c	23 Jan 2007 10:01:11 -0000	1.230.2.17
+++ mail-index.c	23 Jan 2007 11:19:39 -0000	1.230.2.18
@@ -788,7 +788,8 @@
 		records_size = (size_t)hdr->messages_count * hdr->record_size;
 
 		if ((uoff_t)st.st_size - hdr->header_size < records_size ||
-		    records_size / hdr->messages_count != hdr->record_size) {
+		    (hdr->record_size != 0 &&
+		     records_size / hdr->record_size != hdr->messages_count)) {
 			records_count = (st.st_size - hdr->header_size) /
 				hdr->record_size;
 			mail_index_set_error(index, "Corrupted index file %s: "



More information about the dovecot-cvs mailing list