From 1433bf361ddb0bba8878c8ada5726d0284edad57 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 14 Jun 2010 20:39:06 +0100 Subject: [PATCH] mailbox_list_get_unexpanded_path(): Don't crash if namespace location is already expanded. --HG-- branch : HEAD --- src/lib-storage/mailbox-list.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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++; } -- 2.47.3