dovecot: Don't crash when listing INBOX and not returning subscr...

dovecot at dovecot.org dovecot at dovecot.org
Sun Jul 1 18:40:00 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/2f9d38b82364
changeset: 5852:2f9d38b82364
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jul 01 02:12:50 2007 +0300
description:
Don't crash when listing INBOX and not returning subscription flags.

diffstat:

1 file changed, 4 insertions(+), 4 deletions(-)
src/lib-storage/list/mailbox-list-fs-iter.c |    8 ++++----

diffs (25 lines):

diff -r fb91e7d729d1 -r 2f9d38b82364 src/lib-storage/list/mailbox-list-fs-iter.c
--- 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 @@ fs_list_get_subscription_flags(struct fs
 {
 	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 @@ list_file(struct fs_list_iterate_context
 	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);


More information about the dovecot-cvs mailing list