dovecot-2.1: acl: Avoid assert-crashing when trying to access in...

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 9 05:04:47 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/95a9428fe68b
changeset: 14094:95a9428fe68b
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 09 05:04:42 2012 +0200
description:
acl: Avoid assert-crashing when trying to access invalid mailbox names.

diffstat:

 src/plugins/acl/acl-backend-vfile.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r 4ced8d2b4a3b -r 95a9428fe68b src/plugins/acl/acl-backend-vfile.c
--- a/src/plugins/acl/acl-backend-vfile.c	Thu Feb 09 04:26:39 2012 +0200
+++ b/src/plugins/acl/acl-backend-vfile.c	Thu Feb 09 05:04:42 2012 +0200
@@ -128,13 +128,14 @@
 static const char *
 acl_backend_vfile_get_local_dir(struct acl_backend *backend, const char *name)
 {
-	struct mail_namespace *ns;
+	struct mail_namespace *ns = mailbox_list_get_namespace(backend->list);
 	const char *dir, *inbox;
 
 	if (*name == '\0')
 		name = NULL;
+	else if (!mailbox_list_is_valid_existing_name(ns->list, name))
+		return NULL;
 
-	ns = mailbox_list_get_namespace(backend->list);
 	if (mail_storage_is_mailbox_file(ns->storage)) {
 		dir = mailbox_list_get_path(ns->list, name,
 					    MAILBOX_LIST_PATH_TYPE_CONTROL);


More information about the dovecot-cvs mailing list