Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix use after free of a->mailbox due to missing strdup
Commit 87ae932 ("Directly add full mailbox to GPG search hints") changed crypt_add_string_to_hints(a->mailbox, &hints) to mutt_list_insert_tail(&hints, a->mailbox). However, there is a behavioural difference between the two functions: crypt_add_string_to_hints() adds a copy of the string to the list, while mutt_list_insert_tail() does not. This leads to a crash because the original a->mailbox is freed prematurely as part of the hints list. Fix this by adding a copy of the original to the list instead. Note that commit 87ae932 originally came from Mutt. Upstream is not affected by this however because their mutt_add_list() functions always copies the data.
- Loading branch information