changeset 14175:72e1e17d2e22

fs layout: Fixed crash when autocreate mailboxes were used and LIST had only invalid patterns.
author Timo Sirainen <tss@iki.fi>
date Thu, 16 Feb 2012 18:10:09 +0200
parents 908bf2312c14
children b88deb09b0f4
files src/lib-storage/list/mailbox-list-fs-iter.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-fs-iter.c	Wed Feb 15 05:49:20 2012 +0200
+++ b/src/lib-storage/list/mailbox-list-fs-iter.c	Thu Feb 16 18:10:09 2012 +0200
@@ -407,7 +407,10 @@
 	ctx->info.ns = _list->ns;
 
 	if (!fs_list_get_valid_patterns(ctx, patterns)) {
-		/* we've only invalid patterns (or INBOX) */
+		/* we've only invalid patterns (or INBOX). create a glob
+		   anyway to avoid any crashes due to glob being accessed
+		   elsewhere */
+		ctx->ctx.glob = imap_match_init(pool, "", TRUE, ctx->sep);
 		return &ctx->ctx;
 	}
 	ctx->ctx.glob = imap_match_init_multiple(pool, ctx->valid_patterns,