From: Timo Sirainen Date: Thu, 16 Apr 2009 23:48:10 +0000 (-0400) Subject: shared mailboxes: Don't assert-crash if trying to look up "" user's mailboxes. X-Git-Tag: 2.0.alpha1~928 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d927bc5618696157fc55eb1f11b5cab05400ed52;p=thirdparty%2Fdovecot%2Fcore.git shared mailboxes: Don't assert-crash if trying to look up "" user's mailboxes. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/shared/shared-storage.c b/src/lib-storage/index/shared/shared-storage.c index 58dc31f30c..8679a2d9c5 100644 --- a/src/lib-storage/index/shared/shared-storage.c +++ b/src/lib-storage/index/shared/shared-storage.c @@ -190,6 +190,7 @@ int shared_storage_get_namespace(struct mail_storage *_storage, return -1; } } + /* successfully matched the name. */ if (userdomain == NULL) { i_assert(username != NULL); @@ -204,6 +205,11 @@ int shared_storage_get_namespace(struct mail_storage *_storage, domain++; } } + if (*userdomain == '\0') { + mail_storage_set_error(_storage, MAIL_ERROR_PARAMS, + "Empty username doesn't exist"); + return -1; + } /* expand the namespace prefix and see if it already exists. this should normally happen only when the mailbox is being opened */