Title: [206593] trunk
Revision
206593
Author
[email protected]
Date
2016-09-29 11:19:31 -0700 (Thu, 29 Sep 2016)

Log Message

URLParser should fail to parse unclosed IPv6 addresses
https://bugs.webkit.org/show_bug.cgi?id=162715

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):

Tools:

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206592 => 206593)


--- trunk/Source/WebCore/ChangeLog	2016-09-29 18:18:04 UTC (rev 206592)
+++ trunk/Source/WebCore/ChangeLog	2016-09-29 18:19:31 UTC (rev 206593)
@@ -1,5 +1,17 @@
 2016-09-29  Alex Christensen  <[email protected]>
 
+        URLParser should fail to parse unclosed IPv6 addresses
+        https://bugs.webkit.org/show_bug.cgi?id=162715
+
+        Reviewed by Tim Horton.
+
+        Covered by new API tests.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::parseHostAndPort):
+
+2016-09-29  Alex Christensen  <[email protected]>
+
         URLParser should ignore tabs at all possible locations
         https://bugs.webkit.org/show_bug.cgi?id=162711
 

Modified: trunk/Source/WebCore/platform/URLParser.cpp (206592 => 206593)


--- trunk/Source/WebCore/platform/URLParser.cpp	2016-09-29 18:18:04 UTC (rev 206592)
+++ trunk/Source/WebCore/platform/URLParser.cpp	2016-09-29 18:19:31 UTC (rev 206593)
@@ -2388,6 +2388,8 @@
         auto ipv6End = iterator;
         while (!ipv6End.atEnd() && *ipv6End != ']')
             ++ipv6End;
+        if (ipv6End.atEnd())
+            return false;
         if (auto address = parseIPv6Host(CodePointIterator<CharacterType>(iterator, ipv6End))) {
             serializeIPv6(address.value());
             if (!ipv6End.atEnd()) {

Modified: trunk/Tools/ChangeLog (206592 => 206593)


--- trunk/Tools/ChangeLog	2016-09-29 18:18:04 UTC (rev 206592)
+++ trunk/Tools/ChangeLog	2016-09-29 18:19:31 UTC (rev 206593)
@@ -1,5 +1,15 @@
 2016-09-29  Alex Christensen  <[email protected]>
 
+        URLParser should fail to parse unclosed IPv6 addresses
+        https://bugs.webkit.org/show_bug.cgi?id=162715
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
+        (TestWebKitAPI::TEST_F):
+
+2016-09-29  Alex Christensen  <[email protected]>
+
         URLParser should ignore tabs at all possible locations
         https://bugs.webkit.org/show_bug.cgi?id=162711
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (206592 => 206593)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2016-09-29 18:18:04 UTC (rev 206592)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2016-09-29 18:19:31 UTC (rev 206593)
@@ -876,6 +876,12 @@
     shouldFail("://:0/", "about:blank");
     shouldFail("about~");
     shouldFail("//C:asdf/foo/bar", "file:///tmp/mock/path");
+    shouldFail("http://[1234::ab#]");
+    shouldFail("http://[1234::ab/]");
+    shouldFail("http://[1234::ab?]");
+    shouldFail("http://[1234::ab@]");
+    shouldFail("http://[1234::ab~]");
+    shouldFail("http://[2001::1");
 }
 
 // These are in the spec but not in the web platform tests.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to