⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 211107 in webkit


Ignore:
Timestamp:
Jan 24, 2017, 1:23:05 PM (10 years ago)
Author:
matthew_hanson@apple.com
Message:

Merge r211067. rdar://problem/29319962

Location:
branches/safari-603-branch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-603-branch/Source/WebCore/ChangeLog

    r211105 r211107  
     12017-01-24  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r211067. rdar://problem/29319962
     4
     5    2017-01-23  Alex Christensen  <achristensen@webkit.org>
     6
     7            URLParser should fail to parse percent-encoded invalid UTF-8 sequences
     8            https://bugs.webkit.org/show_bug.cgi?id=167330
     9            <rdar://problem/29319962>
     10
     11            Reviewed by Tim Horton.
     12
     13            Covered by new API tests.
     14
     15            * platform/URLParser.cpp:
     16            (WebCore::containsOnlyASCII):
     17            (WebCore::URLParser::parseHostAndPort):
     18            If UTF-8 decoding fails after percent-decoding the host, fail to parse.
     19            This matches Chrome and Firefox, and it was proposed to the spec in https://github.com/whatwg/url/issues/215
     20
    1212017-01-24  Matthew Hanson  <matthew_hanson@apple.com>
    222
  • branches/safari-603-branch/Source/WebCore/platform/URLParser.cpp

    r211105 r211107  
    24542454ALWAYS_INLINE static bool containsOnlyASCII(const String& string)
    24552455{
     2456    ASSERT(!string.isNull());
    24562457    if (string.is8Bit())
    24572458        return charactersAreAllASCII(string.characters8(), string.length());
     
    26712672    Vector<LChar, defaultInlineBufferSize> percentDecoded = percentDecode(utf8Encoded.data(), utf8Encoded.size(), hostBegin);
    26722673    String domain = String::fromUTF8(percentDecoded.data(), percentDecoded.size());
     2674    if (domain.isNull())
     2675        return false;
    26732676    if (domain != StringView(percentDecoded.data(), percentDecoded.size()))
    26742677        syntaxViolation(hostBegin);
  • branches/safari-603-branch/Tools/ChangeLog

    r211105 r211107  
     12017-01-24  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r211067. rdar://problem/29319962
     4
     5    2017-01-23  Alex Christensen  <achristensen@webkit.org>
     6
     7            URLParser should fail to parse percent-encoded invalid UTF-8 sequences
     8            https://bugs.webkit.org/show_bug.cgi?id=167330
     9
     10            Reviewed by Tim Horton.
     11
     12            * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
     13            (TestWebKitAPI::TEST_F):
     14
    1152017-01-24  Matthew Hanson  <matthew_hanson@apple.com>
    216
  • branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp

    r211105 r211107  
    788788        {"file", "", "", "", 0, "/pAtH/", "", "", "file:///pAtH/"},
    789789        {"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/"});
    791796    checkURLDifferences("http://host%73",
    792797        {"http", "", "", "hosts", 0, "/", "", "", "http://hosts/"},
Note: See TracChangeset for help on using the changeset viewer.