[dovecot-cvs] dovecot/src/lib-storage/list index-mailbox-list-sync.c, 1.1, 1.2

tss at dovecot.org tss at dovecot.org
Wed Dec 6 14:46:40 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/list
In directory talvi:/tmp/cvs-serv31670

Modified Files:
	index-mailbox-list-sync.c 
Log Message:
Don't crash with in-memory indexes



Index: index-mailbox-list-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/list/index-mailbox-list-sync.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- index-mailbox-list-sync.c	25 Nov 2006 22:17:50 -0000	1.1
+++ index-mailbox-list-sync.c	6 Dec 2006 14:46:37 -0000	1.2
@@ -422,6 +422,14 @@
 			index_list_get_status(box, status_items, status_r);
 	}
 
+	list = mail_storage_get_list(box->storage);
+	ilist = INDEX_LIST_CONTEXT(list);
+
+	if (ilist == NULL) {
+		/* indexing disabled */
+		return ibox->super.sync_deinit(ctx, status_items, status_r);
+	}
+
 	/* if status_items == 0, the status_r may be NULL. we really want to
 	   know the status anyway, so save it elsewhere then */
 	status = status_items == 0 ? &tmp_status : status_r;
@@ -432,9 +440,6 @@
 	ctx = NULL;
 
 	/* sync mailbox list index */
-	list = mail_storage_get_list(box->storage);
-	ilist = INDEX_LIST_CONTEXT(list);
-
 	if (index_list_lookup_or_create(ilist, box, &uid) < 0) {
 		/* just ignore the error */
 		return 0;



More information about the dovecot-cvs mailing list