diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/misc.h | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -33,13 +33,14 @@ static inline void a_Misc_parse_content_disposition(const char *disposition, cha const char terminators[] = " ;\t"; const char *str, *s; - if (type) - *type = NULL; - if (filename) - *filename = NULL; - if (!(str = disposition)) + /* All are mandatory */ + if (!disposition || !type || !filename) return; + *type = NULL; + *filename = NULL; + str = disposition; + for (s = str; *s && d_isascii((uchar_t)*s) && !iscntrl((uchar_t)*s) && !strchr(tspecials_space, *s); s++) ; if (type && !(s == str)) |