dovecot-2.2: imapc: Don't crash when using multiple imapc namesp...

dovecot at dovecot.org dovecot at dovecot.org
Sun Jun 24 20:57:39 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/b13753851a07
changeset: 14665:b13753851a07
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jun 21 18:48:38 2012 +0300
description:
imapc: Don't crash when using multiple imapc namespaces.

diffstat:

 src/lib-storage/index/imapc/imapc-storage.c |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (32 lines):

diff -r 4461b48fcc1f -r b13753851a07 src/lib-storage/index/imapc/imapc-storage.c
--- a/src/lib-storage/index/imapc/imapc-storage.c	Wed Jun 20 02:21:54 2012 +0300
+++ b/src/lib-storage/index/imapc/imapc-storage.c	Thu Jun 21 18:48:38 2012 +0300
@@ -275,6 +275,19 @@
 	imapc_client_deinit(&storage->client);
 }
 
+static void imapc_storage_add_list(struct mail_storage *_storage,
+				   struct mailbox_list *_list)
+{
+	struct imapc_storage *storage = (struct imapc_storage *)_storage;
+	struct imapc_mailbox_list *list = (struct imapc_mailbox_list *)_list;
+
+	i_assert(storage->list != NULL);
+	i_assert(storage->list->sep != '\0');
+
+	list->storage = storage;
+	list->sep = storage->list->sep;
+}
+
 void imapc_storage_register_untagged(struct imapc_storage *storage,
 				     const char *name,
 				     imapc_storage_callback_t *callback)
@@ -752,7 +765,7 @@
 		imapc_storage_alloc,
 		imapc_storage_create,
 		imapc_storage_destroy,
-		NULL,
+		imapc_storage_add_list,
 		imapc_storage_get_list_settings,
 		NULL,
 		imapc_mailbox_alloc,


More information about the dovecot-cvs mailing list