[dovecot-cvs] dovecot/src/lib-index mail-index.c,1.259,1.260
tss at dovecot.org
tss at dovecot.org
Tue Jan 23 10:01:18 UTC 2007
Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv2155
Modified Files:
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.259
retrieving revision 1.260
diff -u -d -r1.259 -r1.260
--- mail-index.c 23 Jan 2007 09:57:58 -0000 1.259
+++ mail-index.c 23 Jan 2007 10:01:13 -0000 1.260
@@ -731,8 +731,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);
@@ -761,7 +761,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,
@@ -788,9 +788,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