#3817: [PATCH] Fedora: Fix crash in IMAP
----------------------+---------------------
Reporter: flatcap | Owner: brendan
Type: defect | Status: closed
Priority: major | Milestone:
Component: IMAP | Version: 1.5.24
Resolution: fixed | Keywords: patch
----------------------+---------------------
Changes (by Kevin McCarthy <kevin@…>):
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"62e478a3f1c8856b3d4855fa287c8212e805e2a9"]:
{{{
#!CommitTicketReference repository=""
revision="62e478a3f1c8856b3d4855fa287c8212e805e2a9"
Fix error handling in sync_helper() and imap_sync_mailbox(). (closes
#3817)
This patch is based on the one Richard Russon found in the Fedora package.
If an error occurs during one of the imap_exec() calls in
imap_sync_mailbox(), the mailbox could end up being closed. This
would cause idata->ctx to be NULL. Add a check in sync_helper() for
the case where idata->ctx == NULL.
In imap_sync_mailbox(), check the return value of sync_helper(). To
keep the code simple, change rc from being the sum of the calls to the
bitwise-OR of the calls. (We only need to know if a single flag needs
to be updated, and bitwise-OR will detect negatives.)
Below the calls to sync_helper(), if the call to imap_exec() fails,
make sure rc is set to -1.
}}}
--
Ticket URL: <https://dev.mutt.org/trac/ticket/3817#comment:5>
Mutt <http://www.mutt.org/>
The Mutt mail user agent