changeset 3457:b5885ba96ec8 HEAD

Don't crash if extension array isn't initialized for index map.
author Timo Sirainen <tss@iki.fi>
date Sun, 03 Jul 2005 13:51:48 +0300
parents 5ec00b12f4db
children 0c264f105899
files src/lib-index/mail-index-sync-ext.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync-ext.c	Sun Jul 03 13:47:38 2005 +0300
+++ b/src/lib-index/mail-index-sync-ext.c	Sun Jul 03 13:51:48 2005 +0300
@@ -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. */