Commit 7953b30a authored by Emanuele Giaquinta's avatar Emanuele Giaquinta

Skip 'attachments' directive if minor type is not a valid regexp

parent 0ea1f155
......@@ -916,6 +916,7 @@ static int parse_attach_list (BUFFER *buf, BUFFER *s, LIST **ldata, BUFFER *err)
char *p;
char *tmpminor;
int len;
int ret;
/* Find the last item in the list that data points to. */
lastp = NULL;
......@@ -965,10 +966,19 @@ static int parse_attach_list (BUFFER *buf, BUFFER *s, LIST **ldata, BUFFER *err)
tmpminor[len+2] = '\0';
a->major_int = mutt_check_mime_type(a->major);
regcomp(&a->minor_rx, tmpminor, REG_ICASE|REG_EXTENDED);
ret = regcomp(&a->minor_rx, tmpminor, REG_ICASE|REG_EXTENDED);
FREE(&tmpminor);
if (ret)
{
regerror(ret, &a->minor_rx, err->data, err->dsize);
regfree(&a->minor_rx);
FREE(&a->major);
FREE(&a);
return -1;
}
dprint(5, (debugfile, "parse_attach_list: added %s/%s [%d]\n",
a->major, a->minor, a->major_int));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment