Diff
Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (211106 => 211107)
--- branches/safari-603-branch/Source/WebCore/ChangeLog 2017-01-24 21:22:59 UTC (rev 211106)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog 2017-01-24 21:23:05 UTC (rev 211107)
@@ -1,5 +1,25 @@
2017-01-24 Matthew Hanson <[email protected]>
+ Merge r211067. rdar://problem/29319962
+
+ 2017-01-23 Alex Christensen <[email protected]>
+
+ URLParser should fail to parse percent-encoded invalid UTF-8 sequences
+ https://bugs.webkit.org/show_bug.cgi?id=167330
+ <rdar://problem/29319962>
+
+ Reviewed by Tim Horton.
+
+ Covered by new API tests.
+
+ * platform/URLParser.cpp:
+ (WebCore::containsOnlyASCII):
+ (WebCore::URLParser::parseHostAndPort):
+ If UTF-8 decoding fails after percent-decoding the host, fail to parse.
+ This matches Chrome and Firefox, and it was proposed to the spec in https://github.com/whatwg/url/issues/215
+
+2017-01-24 Matthew Hanson <[email protected]>
+
Merge r211058. rdar://problem/29526875
2017-01-23 Alex Christensen <[email protected]>
Modified: branches/safari-603-branch/Source/WebCore/platform/URLParser.cpp (211106 => 211107)
--- branches/safari-603-branch/Source/WebCore/platform/URLParser.cpp 2017-01-24 21:22:59 UTC (rev 211106)
+++ branches/safari-603-branch/Source/WebCore/platform/URLParser.cpp 2017-01-24 21:23:05 UTC (rev 211107)
@@ -2453,6 +2453,7 @@
ALWAYS_INLINE static bool containsOnlyASCII(const String& string)
{
+ ASSERT(!string.isNull());
if (string.is8Bit())
return charactersAreAllASCII(string.characters8(), string.length());
return charactersAreAllASCII(string.characters16(), string.length());
@@ -2670,6 +2671,8 @@
}
Vector<LChar, defaultInlineBufferSize> percentDecoded = percentDecode(utf8Encoded.data(), utf8Encoded.size(), hostBegin);
String domain = String::fromUTF8(percentDecoded.data(), percentDecoded.size());
+ if (domain.isNull())
+ return false;
if (domain != StringView(percentDecoded.data(), percentDecoded.size()))
syntaxViolation(hostBegin);
auto asciiDomain = domainToASCII(domain, hostBegin);
Modified: branches/safari-603-branch/Tools/ChangeLog (211106 => 211107)
--- branches/safari-603-branch/Tools/ChangeLog 2017-01-24 21:22:59 UTC (rev 211106)
+++ branches/safari-603-branch/Tools/ChangeLog 2017-01-24 21:23:05 UTC (rev 211107)
@@ -1,5 +1,19 @@
2017-01-24 Matthew Hanson <[email protected]>
+ Merge r211067. rdar://problem/29319962
+
+ 2017-01-23 Alex Christensen <[email protected]>
+
+ URLParser should fail to parse percent-encoded invalid UTF-8 sequences
+ https://bugs.webkit.org/show_bug.cgi?id=167330
+
+ Reviewed by Tim Horton.
+
+ * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
+ (TestWebKitAPI::TEST_F):
+
+2017-01-24 Matthew Hanson <[email protected]>
+
Merge r211058. rdar://problem/29526875
2017-01-23 Alex Christensen <[email protected]>
Modified: branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (211106 => 211107)
--- branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp 2017-01-24 21:22:59 UTC (rev 211106)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp 2017-01-24 21:23:05 UTC (rev 211107)
@@ -787,7 +787,12 @@
checkURLDifferences("file:pAtH/",
{"file", "", "", "", 0, "/pAtH/", "", "", "file:///pAtH/"},
{"file", "", "", "", 0, "pAtH/", "", "", "file://pAtH/"});
-
+ checkURLDifferences("http://example.com%A0",
+ {"", "", "", "", 0, "", "", "", "http://example.com%A0"},
+ {"http", "", "", "example.com%a0", 0, "/", "", "", "http://example.com%a0/"});
+ checkURLDifferences("http://%E2%98%83",
+ {"http", "", "", "xn--n3h", 0, "/", "", "", "http://xn--n3h/"},
+ {"http", "", "", "%e2%98%83", 0, "/", "", "", "http://%e2%98%83/"});
checkURLDifferences("http://host%73",
{"http", "", "", "hosts", 0, "/", "", "", "http://hosts/"},
{"http", "", "", "host%73", 0, "/", "", "", "http://host%73/"});
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
