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.
---
 src/mime/backend/mailcap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mime/backend/mailcap.c b/src/mime/backend/mailcap.c
index 5abe9416..4e7a9224 100644
--- a/src/mime/backend/mailcap.c
+++ b/src/mime/backend/mailcap.c
@@ -301,6 +301,7 @@ parse_optional_fields(struct mailcap_entry *entry, unsigned 
char *line)
                        for (field = entry->testcommand; *field; field++)
                                if (*field == '%' && *(field+1) == 's') {
                                        mem_free(entry->testcommand);
+                                       entry->testcommand = NULL;
                                        return 0;
                                }
 
-- 
2.11.0

-- 
http://lists.linuxfromscratch.org/listinfo/elinks-dev
Unsubscribe: See the above information page

Reply via email to