Commit 41816374 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Fix QRESYNC crash after a large number of VANISHED messages.

When handling QRESYNC vanished, imap_expunge_mailbox() was called to
empty out the messages.  Various counters, including vcount are
updated by the mx_update_tables() after the expunge.

These counters need to be reset, because mx_update_context() will do
so once again at the end of reading new headers.  This can cause an
out of bounds access in v2r.
parent 3b75515c
Pipeline #38132807 passed with stage
in 13 minutes and 21 seconds
......@@ -652,6 +652,18 @@ static int read_headers_condstore_qresync_updates (IMAP_DATA *idata,
imap_hcache_close (idata);
imap_expunge_mailbox (idata);
/* undo expunge count updates.
* mx_update_context() will do this at the end of the header fetch. */
ctx->vcount = 0;
ctx->vsize = 0;
ctx->tagged = 0;
ctx->deleted = 0;
ctx->new = 0;
ctx->unread = 0;
ctx->changed = 0;
ctx->flagged = 0;
idata->hcache = imap_hcache_open (idata, NULL);
idata->reopen &= ~IMAP_EXPUNGE_PENDING;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment