From: Timo Sirainen Date: Mon, 14 Jun 2010 19:39:06 +0000 (+0100) Subject: mailbox_list_get_unexpanded_path(): Don't crash if namespace location is already... X-Git-Tag: 2.0.rc1~172 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1433bf361ddb0bba8878c8ada5726d0284edad57;p=thirdparty%2Fdovecot%2Fcore.git mailbox_list_get_unexpanded_path(): Don't crash if namespace location is already expanded. --HG-- branch : HEAD --- diff --git a/src/lib-storage/mailbox-list.c b/src/lib-storage/mailbox-list.c index becf5c7a3b..79b3ce65c5 100644 --- a/src/lib-storage/mailbox-list.c +++ b/src/lib-storage/mailbox-list.c @@ -315,6 +315,11 @@ const char *mailbox_list_get_unexpanded_path(struct mailbox_list *list, struct mailbox_list_settings set; const char *p, *error; + if (*location == '1') { + /* set using -o or userdb lookup. */ + return ""; + } + i_assert(*location == '0'); location++; @@ -323,10 +328,8 @@ const char *mailbox_list_get_unexpanded_path(struct mailbox_list *list, user->unexpanded_set, MAIL_STORAGE_SET_DRIVER_NAME); i_assert(mail_set != NULL); location = mail_set->mail_location; - if (*location == '1') { - /* we'll get here if using -o mail_location=.. */ + if (*location == '1') return ""; - } i_assert(*location == '0'); location++; }