[dovecot-cvs] dovecot/src/lib-index mail-index-sync-ext.c, 1.3, 1.4 mail-index.c, 1.185, 1.186

cras at dovecot.org cras at dovecot.org
Sun Jan 16 20:42:00 EET 2005


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

Modified Files:
	mail-index-sync-ext.c mail-index.c 
Log Message:
Added asserts



Index: mail-index-sync-ext.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync-ext.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mail-index-sync-ext.c	20 Dec 2004 07:45:41 -0000	1.3
+++ mail-index-sync-ext.c	16 Jan 2005 18:41:58 -0000	1.4
@@ -306,6 +306,7 @@
 		modified = TRUE;
 
 	if (modified) {
+		i_assert((map->hdr_copy_buf->used % sizeof(uint64_t)) == 0);
 		map->hdr_base = map->hdr_copy_buf->data;
 		map->hdr.header_size = map->hdr_copy_buf->used;
 
@@ -412,6 +413,7 @@
 		MAIL_INDEX_HEADER_SIZE_ALIGN(ext->hdr_size));
 	i_assert(hdr_buf->used ==
 		 hdr_offset + MAIL_INDEX_HEADER_SIZE_ALIGN(ext->hdr_size));
+	i_assert((hdr_buf->used % sizeof(uint64_t)) == 0);
 
 	map->hdr.header_size = hdr_buf->used;
 	map->hdr_base = map->hdr_copy_buf->data;

Index: mail-index.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index.c,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -d -r1.185 -r1.186
--- mail-index.c	10 Jan 2005 17:37:22 -0000	1.185
+++ mail-index.c	16 Jan 2005 18:41:58 -0000	1.186
@@ -1162,6 +1162,8 @@
 {
 	time_t now = time(NULL);
 
+	i_assert((sizeof(*hdr) % sizeof(uint64_t)) == 0);
+
 	memset(hdr, 0, sizeof(*hdr));
 
 	hdr->major_version = MAIL_INDEX_MAJOR_VERSION;



More information about the dovecot-cvs mailing list