]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Fix assert-crash when deleting mailbox triggers mailbox_get_open_status().
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 17 Nov 2016 00:48:20 +0000 (02:48 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 18 Nov 2016 11:47:01 +0000 (13:47 +0200)
For example vsize header updating triggers this.

Fixes:
Panic: file mail-storage.c: line 1683: unreached

src/lib-storage/index/imapc/imapc-storage.c

index eee8dfe817cc49a9eb69f7f4156b51b6872c193b..eed21b9ea72ed477daefe1c37d34bcebf1ff5079 100644 (file)
@@ -895,7 +895,7 @@ static int imapc_mailbox_get_status(struct mailbox *box,
                        return -1;
        }
 
-       if (box->opened && (items & STATUS_UIDNEXT) != 0 &&
+       if (box->opened && !box->deleting && (items & STATUS_UIDNEXT) != 0 &&
            mbox->sync_uid_next == 0) {
                /* Courier-workaround, it doesn't send UIDNEXT on SELECT */
                if (imapc_mailbox_run_status(box, STATUS_UIDNEXT, status_r) < 0)