Title: [205988] trunk
Revision
205988
Author
achristen...@apple.com
Date
2016-09-15 11:20:33 -0700 (Thu, 15 Sep 2016)

Log Message

URLParser: Check for invalid characters in the host
https://bugs.webkit.org/show_bug.cgi?id=162023

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::failure):
(WebCore::URLParser::parseHost):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (205987 => 205988)


--- trunk/Source/WebCore/ChangeLog	2016-09-15 18:16:47 UTC (rev 205987)
+++ trunk/Source/WebCore/ChangeLog	2016-09-15 18:20:33 UTC (rev 205988)
@@ -1,3 +1,16 @@
+2016-09-15  Alex Christensen  <achristen...@webkit.org>
+
+        URLParser: Check for invalid characters in the host
+        https://bugs.webkit.org/show_bug.cgi?id=162023
+
+        Reviewed by Tim Horton.
+
+        Covered by new API tests.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::failure):
+        (WebCore::URLParser::parseHost):
+
 2016-09-15  Antti Koivisto  <an...@apple.com>
 
         Remove some extra spaces.

Modified: trunk/Source/WebCore/platform/URLParser.cpp (205987 => 205988)


--- trunk/Source/WebCore/platform/URLParser.cpp	2016-09-15 18:16:47 UTC (rev 205987)
+++ trunk/Source/WebCore/platform/URLParser.cpp	2016-09-15 18:20:33 UTC (rev 205988)
@@ -1680,6 +1680,8 @@
                 continue;
             if (*iterator == ':')
                 break;
+            if (isInvalidDomainCharacter(*iterator))
+                return false;
         }
         if (auto address = parseIPv4Host(CodePointIterator<CharacterType>(hostIterator, iterator))) {
             serializeIPv4(address.value(), m_buffer);

Modified: trunk/Tools/ChangeLog (205987 => 205988)


--- trunk/Tools/ChangeLog	2016-09-15 18:16:47 UTC (rev 205987)
+++ trunk/Tools/ChangeLog	2016-09-15 18:20:33 UTC (rev 205988)
@@ -1,3 +1,13 @@
+2016-09-15  Alex Christensen  <achristen...@webkit.org>
+
+        URLParser: Check for invalid characters in the host
+        https://bugs.webkit.org/show_bug.cgi?id=162023
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
+        (TestWebKitAPI::TEST_F):
+
 2016-09-15  Fujii Hironori  <hironori.fu...@sony.com>
 
         [CMake] Refactor GENERATE_BINDINGS

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (205987 => 205988)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2016-09-15 18:16:47 UTC (rev 205987)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2016-09-15 18:20:33 UTC (rev 205988)
@@ -588,6 +588,10 @@
     shouldFail("/i", "sc:sd/sd");
     shouldFail("?i", "sc:sd");
     shouldFail("?i", "sc:sd/sd");
+    shouldFail("http://example example.com", "http://other.com/");
+    shouldFail("http://[www.example.com]/", "about:blank");
+    shouldFail("http://192.168.0.1 hello", "http://other.com/");
+    shouldFail("http://[example.com]", "http://other.com/");
 }
 
 // These are in the spec but not in the web platform tests.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to