# HG changeset patch # User Timo Sirainen # Date 1239925690 14400 # Node ID 9619fbd698d5cb42ea9839d4743812eacb152b34 # Parent 8de5b2a19a08d418fe807b08114f1354c66d3894 shared mailboxes: Don't assert-crash if trying to look up "" user's mailboxes. diff -r 8de5b2a19a08 -r 9619fbd698d5 src/lib-storage/index/shared/shared-storage.c --- 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 */