changeset 5852:2f9d38b82364 HEAD

Don't crash when listing INBOX and not returning subscription flags.
author Timo Sirainen <tss@iki.fi>
date Sun, 01 Jul 2007 02:12:50 +0300
parents fb91e7d729d1
children d9f319a9d6e0
files src/lib-storage/list/mailbox-list-fs-iter.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/list/mailbox-list-fs-iter.c	Sun Jul 01 01:40:25 2007 +0300
+++ b/src/lib-storage/list/mailbox-list-fs-iter.c	Sun Jul 01 02:12:50 2007 +0300
@@ -211,6 +211,9 @@
 {
 	struct mailbox_node *node;
 
+	if ((ctx->ctx.flags & MAILBOX_LIST_ITER_RETURN_SUBSCRIBED) == 0)
+		return 0;
+
 	node = mailbox_tree_lookup(ctx->subs_tree, mailbox);
 	if (node == NULL)
 		return 0;
@@ -276,10 +279,7 @@
 	if (ret <= 0)
 		return ret;
 
-	if ((ctx->ctx.flags & MAILBOX_LIST_ITER_RETURN_SUBSCRIBED) != 0) {
-		ctx->info.flags |=
-			fs_list_get_subscription_flags(ctx, list_path);
-	}
+	ctx->info.flags |= fs_list_get_subscription_flags(ctx, list_path);
 
 	/* make sure we give only one correct INBOX */
 	real_path = t_strconcat(ctx->dir->real_path, "/", fname, NULL);