mutt-kz
mutt-kz copied to clipboard
fix crash when notmuch tries to read a message
In mutt_display_message() the CH_VIRTUAL flag was set to tell notmuch to display the Tags message header. Unfortunately, it was always set, even if the mailbox wasn't virtual.
The flags are passed down the call stack:
- mutt_copy_message()
- _mutt_copy_message()
- mutt_copy_header()
Where the code then deferences the private data on the HEADER object.
#ifdef USE_NOTMUCH
if ((flags & CH_VIRTUAL) && nm_header_get_tags(h))
fputs (nm_header_get_tags(h), out);
#endif
If the mailbox isn't virtual, this isn't our data and the results will be undefined. On a 32-bit machine, it crashes.