From: Timo Sirainen Date: Mon, 11 Sep 2017 09:27:17 +0000 (+0300) Subject: lib-storage: Fix mailbox list notification assert-crash when mailbox is deleted X-Git-Tag: 2.3.0.rc1~1033 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2912eac52610bf9463e48f320a966d0b0c51bed0;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Fix mailbox list notification assert-crash when mailbox is deleted Reproduced with if IMAP NOTIFY is used for non-selected mailboxes without MailboxName being specified. Another session then does changes to a mailbox and immediately deletes it, which causes the crash. Fixes: Panic: file mailbox-list-index-notify.c: line 751: unreached --- diff --git a/src/lib-storage/list/mailbox-list-index-notify.c b/src/lib-storage/list/mailbox-list-index-notify.c index 249d09f25f..d121ff50ad 100644 --- a/src/lib-storage/list/mailbox-list-index-notify.c +++ b/src/lib-storage/list/mailbox-list-index-notify.c @@ -748,8 +748,12 @@ mailbox_list_index_notify_change(struct mailbox_list_notify_index *inotify, if (!mailbox_list_index_notify_lookup(inotify, inotify->view, uid, notify_status_items, - &status, &rec)) - i_unreached(); + &status, &rec)) { + /* Mailbox is already deleted. We won't get here if we're + tracking MAILBOX_LIST_NOTIFY_DELETE or _RENAME + (which update expunged_uids). */ + return FALSE; + } /* get the old status */ nnode = mailbox_list_notify_tree_lookup(inotify->tree,