dovecot-2.0: imap: LIST "" inbox shouldn't crash when using name...

dovecot at dovecot.org dovecot at dovecot.org
Wed Dec 23 23:01:08 EET 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/35dbb3595beb
changeset: 10530:35dbb3595beb
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Dec 23 16:01:02 2009 -0500
description:
imap: LIST "" inbox shouldn't crash when using namespace with "INBOX." prefix.

diffstat:

1 file changed, 6 insertions(+), 2 deletions(-)
src/imap/cmd-list.c |    8 ++++++--

diffs (19 lines):

diff -r c8322124d615 -r 35dbb3595beb src/imap/cmd-list.c
--- a/src/imap/cmd-list.c	Wed Dec 23 13:03:56 2009 -0500
+++ b/src/imap/cmd-list.c	Wed Dec 23 16:01:02 2009 -0500
@@ -223,9 +223,13 @@ static const char *ns_get_listed_prefix(
 	struct imap_match_glob *glob;
 	enum imap_match_result match;
 	const char *ns_prefix, *p;
-
+	bool inboxcase;
+
+	inboxcase = strncasecmp(ctx->ns->prefix, "INBOX", 5) == 0 &&
+		ctx->ns->prefix[5] == ctx->ns->sep;
 	glob = imap_match_init_multiple(pool_datastack_create(),
-					ctx->patterns, FALSE, ctx->ns->sep);
+					ctx->patterns, inboxcase,
+					ctx->ns->sep);
 	ns_prefix = ctx->ns->prefix;
 	match = imap_match(glob, ns_prefix);
 	if (match == IMAP_MATCH_YES) {


More information about the dovecot-cvs mailing list