From: Timo Sirainen Date: Fri, 31 May 2013 23:56:25 +0000 (+0300) Subject: lib-storage: Empty mailbox name isn't valid. X-Git-Tag: 2.2.3~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=64ee8113a88e5d6e3cba7b1c4abd537cc2632bb9;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Empty mailbox name isn't valid. --- diff --git a/src/lib-storage/mailbox-list.c b/src/lib-storage/mailbox-list.c index 5eedf047d0..cdf3201c98 100644 --- a/src/lib-storage/mailbox-list.c +++ b/src/lib-storage/mailbox-list.c @@ -1188,10 +1188,14 @@ mailbox_list_is_valid_fs_name(struct mailbox_list *list, const char *name, bool mailbox_list_is_valid_name(struct mailbox_list *list, const char *name, const char **error_r) { - if (*name == '\0' && *list->ns->prefix != '\0') { - /* an ugly way to get to mailbox root (e.g. Maildir/ when - it's not the INBOX) */ - return TRUE; + if (*name == '\0') { + if (*list->ns->prefix != '\0') { + /* an ugly way to get to mailbox root (e.g. Maildir/ + when it's not the INBOX) */ + return TRUE; + } + *error_r = "Name is empty"; + return FALSE; } return mailbox_list_is_valid_fs_name(list, name, error_r);