From: Timo Sirainen Date: Fri, 1 May 2009 21:07:38 +0000 (-0400) Subject: shared mailboxes: Don't crash if trying to open "shared/domain" namespace prefix... X-Git-Tag: 2.0.alpha1~853 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42f68772cf11237cdc7f814058222b83cedf4434;p=thirdparty%2Fdovecot%2Fcore.git shared mailboxes: Don't crash if trying to open "shared/domain" namespace prefix as mailbox. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/shared/shared-storage.c b/src/lib-storage/index/shared/shared-storage.c index e4d7f1e607..8764a39259 100644 --- a/src/lib-storage/index/shared/shared-storage.c +++ b/src/lib-storage/index/shared/shared-storage.c @@ -193,7 +193,13 @@ int shared_storage_get_namespace(struct mail_storage *_storage, /* successfully matched the name. */ if (userdomain == NULL) { - i_assert(username != NULL); + if (username == NULL) { + /* trying to open namespace "shared/domain" + namespace prefix. */ + mail_storage_set_error(_storage, MAIL_ERROR_NOTFOUND, + T_MAIL_ERR_MAILBOX_NOT_FOUND(*_name)); + return -1; + } userdomain = domain == NULL ? username : t_strconcat(username, "@", domain, NULL); } else {