The content sniffing loop that checks the content patterns was not
controlling the length of each pattern.
https://bugzilla.gnome.org/show_bug.cgi?id=597545
int index_pattern = 0;
gboolean skip_row = FALSE;
- while (index_stream < resource_length) {
+ while ((index_stream < resource_length) &&
+ (index_pattern <= type_row->pattern_length)) {
/* Skip insignificant white space ("WS" in the spec) */
if (type_row->pattern[index_pattern] == ' ') {
if (resource[index_stream] == '\x09' ||