dovecot-2.0: doveadm: Fixed assert-crash when listing mailbox foo/*

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 18 23:41:19 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/9a852084bbeb
changeset: 11588:9a852084bbeb
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 18 21:41:13 2010 +0100
description:
doveadm: Fixed assert-crash when listing mailbox foo/*

diffstat:

 src/doveadm/doveadm-mail-fetch.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (25 lines):

diff -r 47c1329e4e65 -r 9a852084bbeb src/doveadm/doveadm-mail-fetch.c
--- a/src/doveadm/doveadm-mail-fetch.c	Fri Jun 18 20:07:20 2010 +0100
+++ b/src/doveadm/doveadm-mail-fetch.c	Fri Jun 18 21:41:13 2010 +0100
@@ -13,6 +13,7 @@
 #include "mail-user.h"
 #include "mail-storage.h"
 #include "mail-search.h"
+#include "mail-namespace.h"
 #include "doveadm-mail.h"
 #include "doveadm-mail-list-iter.h"
 #include "doveadm-mail-iter.h"
@@ -397,6 +398,13 @@
 	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)


More information about the dovecot-cvs mailing list