#3800: Segfault after attaching, detaching and reattaching files using Attach:
pseudoheader
----------------------+-------------------------
Reporter: dabsent | Owner: mutt-dev
Type: defect | Status: closed
Priority: major | Milestone:
Component: mutt | Version: 1.5.24
Resolution: fixed | Keywords: attachments
----------------------+-------------------------
Changes (by Kevin McCarthy <kevin@…>):
* status: reopened => closed
* resolution: => fixed
Comment:
In [f99561e22a9967c96c68d81dfc68b4d524a66ac5]:
{{{
#!CommitTicketReference repository=""
revision="f99561e22a9967c96c68d81dfc68b4d524a66ac5"
Fix segfault when deleting and reusing attachment slots. (closes #3800)
When attachments are deleted, delete_attachment() slides the entries
down in the idx array, but forgets to NULL out the last vacated slot.
If more attachments are added later on via OP_COMPOSE_EDIT_HEADERS and
the Attach: pseudo-header, mutt_gen_attach_list() will attempt to
re-use the ATTACHPTR in that last slot because it wasn't set to NULL.
This will be pointing to freed memory and likely segfault (at best).
}}}
--
Ticket URL: <http://dev.mutt.org/trac/ticket/3800#comment:7>
Mutt <http://www.mutt.org/>
The Mutt mail user agent