]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
shared mailboxes: Don't assert-crash if trying to look up "" user's mailboxes.
authorTimo Sirainen <tss@iki.fi>
Thu, 16 Apr 2009 23:48:10 +0000 (19:48 -0400)
committerTimo Sirainen <tss@iki.fi>
Thu, 16 Apr 2009 23:48:10 +0000 (19:48 -0400)
--HG--
branch : HEAD

src/lib-storage/index/shared/shared-storage.c

index 58dc31f30c6e61d9d6b6cd6fd25c613cd0dca04d..8679a2d9c5c3186ae013e00373ce12677447a9db 100644 (file)
@@ -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 */