Skip to content

Commit 49f4962

Browse files
committed
Warn about Content-Type headers that are malformed after the type/subtype
e.g: Content-Type: text/Here comes some crap Fixes issue #181
1 parent 17c0f83 commit 49f4962

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gmime/gmime-content-type.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,10 @@ _g_mime_content_type_parse (GMimeParserOptions *options, const char *str, gint64
212212

213213
/* skip past any remaining junk that shouldn't be here... */
214214
skip_cfws (&inptr);
215-
while (*inptr && *inptr != ';')
215+
while (*inptr && *inptr != ';') {
216+
_g_mime_parser_options_warn (options, offset, GMIME_WARN_INVALID_CONTENT_TYPE, str);
216217
inptr++;
218+
}
217219

218220
if (*inptr++ == ';' && *inptr && (params = _g_mime_param_list_parse (options, inptr, offset))) {
219221
g_mime_event_add (params->changed, (GMimeEventCallback) param_list_changed, content_type);

0 commit comments

Comments
 (0)