mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-02 08:57:19 -04:00
mailcap: prevent segfault on test entry with %s
When a mailcap entry with a testcommand containing %s is encountered, it is ignored. The entry was freed, but not set to NULL, leading to a segfault later on.
This commit is contained in:
parent
6d78cf1c23
commit
e957e60d5c
@ -301,6 +301,7 @@ parse_optional_fields(struct mailcap_entry *entry, unsigned char *line)
|
|||||||
for (field = entry->testcommand; *field; field++)
|
for (field = entry->testcommand; *field; field++)
|
||||||
if (*field == '%' && *(field+1) == 's') {
|
if (*field == '%' && *(field+1) == 's') {
|
||||||
mem_free(entry->testcommand);
|
mem_free(entry->testcommand);
|
||||||
|
entry->testcommand = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user