diff options
author | Emanuele Giaquinta <e.giaquinta@glauco.it> | 2010-07-18 22:09:06 +0100 |
---|---|---|
committer | Emanuele Giaquinta <e.giaquinta@glauco.it> | 2010-07-18 22:09:06 +0100 |
commit | 7953b30ab2889d59b5ddd96c2ff0f4fb7b618402 (patch) | |
tree | 711cb9a48061ea3253b263bceae110c280277249 | |
parent | 0ea1f155e7c9a1cc860008b4ac3612a76f3b4426 (diff) |
Skip 'attachments' directive if minor type is not a valid regexp
-rw-r--r-- | init.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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)); |