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

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


details:   http://hg.dovecot.org/dovecot-1.3/rev/a061db71e166
changeset: 9124:a061db71e166
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 edcafb3efbbf -r a061db71e166 src/lib-storage/index/shared/shared-storage.c
--- a/src/lib-storage/index/shared/shared-storage.c	Thu Apr 16 19:14:23 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