dovecot-2.0: doveadm: Fixed assert-crash with mailbox foo/* in a...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jun 19 22:57:45 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/573cb66e9180
changeset: 11589:573cb66e9180
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jun 19 20:57:42 2010 +0100
description:
doveadm: Fixed assert-crash with mailbox foo/* in all commands, not just fetch.

diffstat:

 src/doveadm/doveadm-mail-fetch.c     |  7 -------
 src/doveadm/doveadm-mail-list-iter.c |  7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (36 lines):

diff -r 9a852084bbeb -r 573cb66e9180 src/doveadm/doveadm-mail-fetch.c
--- a/src/doveadm/doveadm-mail-fetch.c	Fri Jun 18 21:41:13 2010 +0100
+++ b/src/doveadm/doveadm-mail-fetch.c	Sat Jun 19 20:57:42 2010 +0100
@@ -398,13 +398,6 @@
 	struct mailbox_transaction_context *trans;
 	struct mail *mail;
 	struct mailbox_header_lookup_ctx *headers = NULL;
-	unsigned int len;
-
-	len = strlen(info->name);
-	if (len > 0 && info->name[len-1] == info->ns->sep) {
-		/* when listing "foo/%" it lists "foo/". skip it. */
-		return 0;
-	}
 
 	if (doveadm_mail_iter_init(info, ctx->ctx.search_args,
 				   &trans, &iter) < 0)
diff -r 9a852084bbeb -r 573cb66e9180 src/doveadm/doveadm-mail-list-iter.c
--- a/src/doveadm/doveadm-mail-list-iter.c	Fri Jun 18 21:41:13 2010 +0100
+++ b/src/doveadm/doveadm-mail-list-iter.c	Sat Jun 19 20:57:42 2010 +0100
@@ -95,8 +95,15 @@
 doveadm_mail_list_iter_next(struct doveadm_mail_list_iter *iter)
 {
 	const struct mailbox_info *info;
+	unsigned int len;
 
 	while ((info = mailbox_list_iter_next(iter->iter)) != NULL) {
+		len = strlen(info->name);
+		if (len > 0 && info->name[len-1] == info->ns->sep) {
+			/* when listing "foo/%" it lists "foo/". skip it. */
+			continue;
+		}
+
 		if (mail_search_args_match_mailbox(iter->search_args,
 						   info->name, info->ns->sep))
 			break;


More information about the dovecot-cvs mailing list