[libsoup] Fixed problem with the content sniffing.



commit fd67f04d04c6babe52b7d148e2abf4f23cee6190
Author: Alejandro G. Castro <alex igalia com>
Date:   Wed Oct 7 20:55:23 2009 +0200

    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

 libsoup/soup-content-sniffer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
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' ||



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]