From 980061e0c19e1b2db1ff736002ce8809cba62886 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 13 Sep 2010 14:43:27 +0100 Subject: [PATCH] acl: Don't break if mailbox listing returns an empty name. --- src/plugins/acl/acl-mailbox-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/acl/acl-mailbox-list.c b/src/plugins/acl/acl-mailbox-list.c index 83cb6df0cb..347c6d2e62 100644 --- a/src/plugins/acl/acl-mailbox-list.c +++ b/src/plugins/acl/acl-mailbox-list.c @@ -224,7 +224,7 @@ acl_mailbox_list_iter_get_name(struct mailbox_list_iterate_context *ctx, 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); -- 2.47.3