dovecot-1.2: shared mailboxes: Don't assert-crash if trying to l...

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 17 02:48:14 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/9619fbd698d5
changeset: 8956:9619fbd698d5
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 16 19:48:10 2009 -0400
description:
shared mailboxes: Don't assert-crash if trying to look up "" user's mailboxes.

diffstat:

1 file changed, 6 insertions(+)
src/lib-storage/index/shared/shared-storage.c |    6 ++++++

diffs (23 lines):

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 @@ int shared_storage_get_namespace(struct 
 			return -1;
 		}
 	}
+
 	/* successfully matched the name. */
 	if (userdomain == NULL) {
 		i_assert(username != NULL);
@@ -204,6 +205,11 @@ int shared_storage_get_namespace(struct 
 			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 */


More information about the dovecot-cvs mailing list