Mercurial > dovecot > core-2.2
changeset 21977:3fcf9d9fa53f
imapc: Fix crash in mailbox_exists() when LAYOUT isn't imapc.
Especially breaks LAYOUT=none.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Sun, 23 Apr 2017 17:19:36 +0300 |
parents | 4430a5cc0a3e |
children | 225072babbce |
files | src/lib-storage/index/imapc/imapc-storage.c |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/imapc/imapc-storage.c Sun Apr 23 13:35:18 2017 +0300 +++ b/src/lib-storage/index/imapc/imapc-storage.c Sun Apr 23 17:19:36 2017 +0300 @@ -495,6 +495,14 @@ imapc_mailbox_exists(struct mailbox *box, bool auto_boxes ATTR_UNUSED, enum mailbox_existence *existence_r) { + if (strcmp(box->list->name, MAILBOX_LIST_NAME_IMAPC) != 0) { + if (box->inbox_any) + *existence_r = MAILBOX_EXISTENCE_SELECT; + else + *existence_r = MAILBOX_EXISTENCE_NONE; + return 0; + } + enum mailbox_info_flags flags; struct imapc_mailbox_list *list = (struct imapc_mailbox_list *)box->list;