dovecot-2.0: acl: Don't break if mailbox listing returns an empt...

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 13 16:43:31 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/4fc447d1281e
changeset: 12103:4fc447d1281e
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 13 14:43:27 2010 +0100
description:
acl: Don't break if mailbox listing returns an empty name.

diffstat:

 src/plugins/acl/acl-mailbox-list.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 7b629b219be5 -r 4fc447d1281e src/plugins/acl/acl-mailbox-list.c
--- a/src/plugins/acl/acl-mailbox-list.c	Mon Sep 13 13:10:31 2010 +0100
+++ b/src/plugins/acl/acl-mailbox-list.c	Mon Sep 13 14:43:27 2010 +0100
@@ -224,7 +224,7 @@
 
 	name = mail_namespace_get_storage_name(ns, name);
 	len = strlen(name);
-	if (name[len-1] == ns->real_sep) {
+	if (len > 0 && name[len-1] == ns->real_sep) {
 		/* name ends with separator. this can happen if doing e.g.
 		   LIST "" foo/% and it lists "foo/". */
 		name = t_strndup(name, len-1);


More information about the dovecot-cvs mailing list