[dovecot-cvs] dovecot/src/lib-index mail-index-sync-ext.c,1.7,1.8

cras at dovecot.org cras at dovecot.org
Sun Jul 3 13:51:51 EEST 2005


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

Modified Files:
	mail-index-sync-ext.c 
Log Message:
Don't crash if extension array isn't initialized for index map.



Index: mail-index-sync-ext.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync-ext.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- mail-index-sync-ext.c	28 Jun 2005 17:06:39 -0000	1.7
+++ mail-index-sync-ext.c	3 Jul 2005 10:51:48 -0000	1.8
@@ -111,8 +111,13 @@
 	sync_handlers =
 		array_get(&ctx->view->index->sync_handlers, &synch_count);
 
-	ext = array_get(&ctx->view->map->extensions, &count);
-	i_assert(count <= synch_count);
+	if (!array_is_created(&ctx->view->map->extensions)) {
+		ext = NULL;
+		count = 0;
+	} else {
+		ext = array_get(&ctx->view->map->extensions, &count);
+		i_assert(count <= synch_count);
+	}
 
 	/* sync_handlers[] is ordered by index->extensions while
 	   extra_contexts[] is ordered by map->extensions. */



More information about the dovecot-cvs mailing list