dovecot-2.2: lib-storage: Fixed assert-crash with mailbox_list_i...

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 23 13:34:54 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/b4a81e123f1a
changeset: 18453:b4a81e123f1a
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 23 16:33:19 2015 +0300
description:
lib-storage: Fixed assert-crash with mailbox_list_index=yes if root mailbox name was empty.
This happened if the index was used for a non-listable namespace whose
prefix started with the namespace separator (e.g. prefix="/expunged/")

diffstat:

 src/lib-storage/list/mailbox-list-index-iter.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r d64fbe56a742 -r b4a81e123f1a src/lib-storage/list/mailbox-list-index-iter.c
--- a/src/lib-storage/list/mailbox-list-index-iter.c	Thu Apr 23 13:37:22 2015 +0300
+++ b/src/lib-storage/list/mailbox-list-index-iter.c	Thu Apr 23 16:33:19 2015 +0300
@@ -73,7 +73,10 @@
 	p_clear(ctx->info_pool);
 
 	str_truncate(ctx->path, ctx->parent_len);
-	if (str_len(ctx->path) > 0) {
+	/* the root directory may have an empty name. in that case we'll still
+	   want to insert the separator, so check for non-NULL parent rather
+	   than non-empty path. */
+	if (node->parent != NULL) {
 		str_append_c(ctx->path,
 			     mailbox_list_get_hierarchy_sep(ctx->ctx.list));
 	}


More information about the dovecot-cvs mailing list