[dovecot-cvs] dovecot/src/lib-index mail-index.c,1.131,1.132

cras at procontrol.fi cras at procontrol.fi
Mon Jun 14 08:26:04 EEST 2004


Update of /home/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv23127/lib-index

Modified Files:
	mail-index.c 
Log Message:
crashfix on error



Index: mail-index.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- mail-index.c	14 Jun 2004 04:27:44 -0000	1.131
+++ mail-index.c	14 Jun 2004 05:26:02 -0000	1.132
@@ -218,6 +218,7 @@
 	}
 
 	hdr = map->mmap_base;
+	map->hdr = hdr;
 	map->mmap_used_size = hdr->header_size +
 		hdr->messages_count * index->record_size;
 
@@ -226,12 +227,11 @@
 			index->record_size;
 		mail_index_set_error(index, "Corrupted index file %s: "
 				     "messages_count too large (%u > %u)",
-				     index->filepath, map->hdr->messages_count,
+				     index->filepath, hdr->messages_count,
 				     records_count);
 		return 0;
 	}
 
-	map->hdr = hdr;
 	if (map->hdr->base_header_size < sizeof(*map->hdr)) {
 		/* header smaller than ours, make a copy so our newer headers
 		   won't have garbage in them */



More information about the dovecot-cvs mailing list