Mercurial > dovecot > core-2.2
changeset 21462:6b4bad2c0840
imap: Fix panic on FETCH X-MAILBOX in virtual mailbox when mail is expunged
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Tue, 31 Jan 2017 21:03:29 +0200 |
parents | 776bf892e493 |
children | 0924bd1d77b3 |
files | src/imap/imap-fetch.c |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/imap/imap-fetch.c Tue Jan 31 13:41:48 2017 +0100 +++ b/src/imap/imap-fetch.c Tue Jan 31 21:03:29 2017 +0200 @@ -867,8 +867,11 @@ const char *name; string_t *mutf7_name; - if (mail_get_special(mail, MAIL_FETCH_MAILBOX_NAME, &name) < 0) - i_panic("mailbox name not returned"); + if (mail_get_special(mail, MAIL_FETCH_MAILBOX_NAME, &name) < 0) { + /* This can happen with virtual mailbox if the backend mail + is expunged. */ + return -1; + } mutf7_name = t_str_new(strlen(name)*2); if (imap_utf8_to_utf7(name, mutf7_name) < 0)