Make an infinite loop introduced in r77454 finite.
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Feb 2011 00:17:34 +0000 (00:17 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Feb 2011 00:17:34 +0000 (00:17 +0000)
Reviewed by Anders Carlsson.

* html/parser/XSSFilter.cpp:
(WebCore::HTMLNames::containsJavaScriptURL):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77697 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/parser/XSSFilter.cpp

index 213bb1b713f85b1d54732862df906bca282a59a3..dc4e297ecb33a1bf9a49c97aedfd8b3644f96501 100644 (file)
@@ -1,3 +1,12 @@
+2011-02-04  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Make an infinite loop introduced in r77454 finite.
+
+        * html/parser/XSSFilter.cpp:
+        (WebCore::HTMLNames::containsJavaScriptURL):
+
 2011-02-04  Jer Noble  <jer.noble@apple.com>
 
         Reviewed by Eric Carlson.
index 913a75c69a3e25d42960904b13a658bd97cf0d59..c6300c1911fd7ec51f76e5103efc037db033b0ca 100644 (file)
@@ -96,8 +96,8 @@ bool containsJavaScriptURL(const Vector<UChar, 32>& value)
     static const char javaScriptScheme[] = "javascript:";
     static const size_t lengthOfJavaScriptScheme = sizeof(javaScriptScheme) - 1;
 
-    size_t i = 0;
-    while (i < value.size()) {
+    size_t i;;
+    for (i = 0; i < value.size(); ++i) {
         if (!isHTMLSpace(value[i]))
             break;
     }