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

tss at dovecot.org tss at dovecot.org
Tue Jan 23 10:01:15 UTC 2007


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

Modified Files:
      Tag: branch_1_0
	mail-index.c 
Log Message:
cleanups



Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.230.2.16
retrieving revision 1.230.2.17
diff -u -d -r1.230.2.16 -r1.230.2.17
--- mail-index.c	23 Jan 2007 09:57:55 -0000	1.230.2.16
+++ mail-index.c	23 Jan 2007 10:01:11 -0000	1.230.2.17
@@ -728,8 +728,8 @@
 	unsigned char buf[512];
 	void *data = NULL;
 	ssize_t ret;
-	size_t pos;
-	unsigned int records_size, records_count;
+	size_t pos, records_size;
+	unsigned int records_count;
 
 	i_assert(map->mmap_base == NULL);
 
@@ -758,7 +758,7 @@
 				hdr->header_size);
 			return 0;
 		}
-		if (hdr->header_size > st.st_size) {
+		if (hdr->header_size > (uoff_t)st.st_size) {
 			mail_index_set_error(index, "Corrupted index file %s: "
 				"Corrupted header size (%u > %"PRIuUOFF_T")",
 				index->filepath, hdr->header_size,
@@ -785,9 +785,9 @@
 
 	if (ret > 0) {
 		/* header read, read the records now. */
-		records_size = hdr->messages_count * hdr->record_size;
+		records_size = (size_t)hdr->messages_count * hdr->record_size;
 
-		if (st.st_size - hdr->header_size < records_size ||
+		if ((uoff_t)st.st_size - hdr->header_size < records_size ||
 		    records_size / hdr->messages_count != hdr->record_size) {
 			records_count = (st.st_size - hdr->header_size) /
 				hdr->record_size;



More information about the dovecot-cvs mailing list