Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8956:9619fbd698d5 HEAD
shared mailboxes: Don't assert-crash if trying to look up "" user's mailboxes.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 16 Apr 2009 19:48:10 -0400 |
parents | 8de5b2a19a08 |
children | d7847f03ae65 |
files | src/lib-storage/index/shared/shared-storage.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/shared/shared-storage.c Thu Apr 16 19:11:32 2009 -0400 +++ b/src/lib-storage/index/shared/shared-storage.c Thu Apr 16 19:48:10 2009 -0400 @@ -190,6 +190,7 @@ return -1; } } + /* successfully matched the name. */ if (userdomain == NULL) { i_assert(username != NULL); @@ -204,6 +205,11 @@ 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 */