Changeset 211067 in webkit
- Timestamp:
- Jan 23, 2017 3:26:55 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r211058 r211067 1 2017-01-23 Alex Christensen <achristensen@webkit.org> 2 3 URLParser should fail to parse percent-encoded invalid UTF-8 sequences 4 https://bugs.webkit.org/show_bug.cgi?id=167330 5 <rdar://problem/29319962> 6 7 Reviewed by Tim Horton. 8 9 Covered by new API tests. 10 11 * platform/URLParser.cpp: 12 (WebCore::containsOnlyASCII): 13 (WebCore::URLParser::parseHostAndPort): 14 If UTF-8 decoding fails after percent-decoding the host, fail to parse. 15 This matches Chrome and Firefox, and it was proposed to the spec in https://github.com/whatwg/url/issues/215 16 1 17 2017-01-23 Alex Christensen <achristensen@webkit.org> 2 18 -
trunk/Source/WebCore/platform/URLParser.cpp
r211058 r211067 2465 2465 ALWAYS_INLINE static bool containsOnlyASCII(const String& string) 2466 2466 { 2467 ASSERT(!string.isNull()); 2467 2468 if (string.is8Bit()) 2468 2469 return charactersAreAllASCII(string.characters8(), string.length()); … … 2682 2683 Vector<LChar, defaultInlineBufferSize> percentDecoded = percentDecode(utf8Encoded.data(), utf8Encoded.size(), hostBegin); 2683 2684 String domain = String::fromUTF8(percentDecoded.data(), percentDecoded.size()); 2685 if (domain.isNull()) 2686 return false; 2684 2687 if (domain != StringView(percentDecoded.data(), percentDecoded.size())) 2685 2688 syntaxViolation(hostBegin); -
trunk/Tools/ChangeLog
r211058 r211067 1 2017-01-23 Alex Christensen <achristensen@webkit.org> 2 3 URLParser should fail to parse percent-encoded invalid UTF-8 sequences 4 https://bugs.webkit.org/show_bug.cgi?id=167330 5 6 Reviewed by Tim Horton. 7 8 * TestWebKitAPI/Tests/WebCore/URLParser.cpp: 9 (TestWebKitAPI::TEST_F): 10 1 11 2017-01-23 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp
r211058 r211067 788 788 {"file", "", "", "", 0, "/pAtH/", "", "", "file:///pAtH/"}, 789 789 {"file", "", "", "", 0, "pAtH/", "", "", "file://pAtH/"}); 790 790 checkURLDifferences("http://example.com%A0", 791 {"", "", "", "", 0, "", "", "", "http://example.com%A0"}, 792 {"http", "", "", "example.com%a0", 0, "/", "", "", "http://example.com%a0/"}); 793 checkURLDifferences("http://%E2%98%83", 794 {"http", "", "", "xn--n3h", 0, "/", "", "", "http://xn--n3h/"}, 795 {"http", "", "", "%e2%98%83", 0, "/", "", "", "http://%e2%98%83/"}); 791 796 checkURLDifferences("http://host%73", 792 797 {"http", "", "", "hosts", 0, "/", "", "", "http://hosts/"},
Note: See TracChangeset
for help on using the changeset viewer.