dovecot-2.2: lib-storage: Fixed crash if mail_namespaces_init_ad...

dovecot at dovecot.org dovecot at dovecot.org
Thu Nov 13 08:59:02 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/02f705783387
changeset: 18081:02f705783387
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Nov 13 10:57:07 2014 +0200
description:
lib-storage: Fixed crash if mail_namespaces_init_add() failed due to invalid settings.
Normally the invalid settings were caught by config process already.

diffstat:

 src/lib-storage/mail-namespace.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (18 lines):

diff -r 4d8a52f5839a -r 02f705783387 src/lib-storage/mail-namespace.c
--- a/src/lib-storage/mail-namespace.c	Thu Nov 13 10:09:28 2014 +0200
+++ b/src/lib-storage/mail-namespace.c	Thu Nov 13 10:57:07 2014 +0200
@@ -54,9 +54,11 @@
 {
 	struct mail_storage **storagep;
 
-	array_foreach_modifiable(&ns->all_storages, storagep)
-		mail_storage_unref(storagep);
-	array_free(&ns->all_storages);
+	if (array_is_created(&ns->all_storages)) {
+		array_foreach_modifiable(&ns->all_storages, storagep)
+			mail_storage_unref(storagep);
+		array_free(&ns->all_storages);
+	}
 	if (ns->list != NULL)
 		mailbox_list_destroy(&ns->list);
 


More information about the dovecot-cvs mailing list