changeset 9009:4fd7b98bcff9 HEAD

shared mailboxes: Don't crash if trying to open "shared/domain" namespace prefix as mailbox.
author Timo Sirainen <tss@iki.fi>
date Fri, 01 May 2009 17:07:38 -0400
parents fc4f65a4ca60
children c2d55b298ec8
files src/lib-storage/index/shared/shared-storage.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/shared/shared-storage.c	Fri May 01 14:56:52 2009 -0400
+++ b/src/lib-storage/index/shared/shared-storage.c	Fri May 01 17:07:38 2009 -0400
@@ -193,7 +193,13 @@
 
 	/* 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 {