From: Alejandro G. Castro Date: Wed, 7 Oct 2009 18:55:23 +0000 (+0200) Subject: Fixed problem with the content sniffing. X-Git-Tag: LIBSOUP_2_28_1~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd67f04d04c6babe52b7d148e2abf4f23cee6190;p=platform%2Fupstream%2Flibsoup.git Fixed problem with the content sniffing. 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 --- diff --git a/libsoup/soup-content-sniffer.c b/libsoup/soup-content-sniffer.c index ed57e7c..d55aab5 100644 --- a/libsoup/soup-content-sniffer.c +++ b/libsoup/soup-content-sniffer.c @@ -279,7 +279,8 @@ sniff_unknown (SoupContentSniffer *sniffer, SoupMessage *msg, 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' ||