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

Changeset 245982 in webkit


Ignore:
Timestamp:
May 31, 2019, 1:55:25 PM (7 years ago)
Author:
achristensen@apple.com
Message:

URLParser::parseHostAndPort should not allow non-port characters after an ipv6 host
https://bugs.webkit.org/show_bug.cgi?id=198428
<rdar://problem/51209196>

Reviewed by Tim Horton.

Source/WTF:

This matches Chrome and Firefox.

  • wtf/URLParser.cpp:

(WTF::URLParser::parseHostAndPort):

Tools:

  • TestWebKitAPI/Tests/WTF/URLParser.cpp:

(TestWebKitAPI::TEST_F):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r245979 r245982  
     12019-05-31  Alex Christensen  <achristensen@webkit.org>
     2
     3        URLParser::parseHostAndPort should not allow non-port characters after an ipv6 host
     4        https://bugs.webkit.org/show_bug.cgi?id=198428
     5        <rdar://problem/51209196>
     6
     7        Reviewed by Tim Horton.
     8
     9        This matches Chrome and Firefox.
     10
     11        * wtf/URLParser.cpp:
     12        (WTF::URLParser::parseHostAndPort):
     13
    1142019-05-31  Tim Horton  <timothy_horton@apple.com>
    215
  • trunk/Source/WTF/wtf/URLParser.cpp

    r243163 r245982  
    26512651            if (!ipv6End.atEnd()) {
    26522652                advance(ipv6End);
    2653                 if (!ipv6End.atEnd() && *ipv6End == ':') {
    2654                     m_url.m_hostEnd = currentPosition(ipv6End);
     2653                m_url.m_hostEnd = currentPosition(ipv6End);
     2654                if (!ipv6End.atEnd() && *ipv6End == ':')
    26552655                    return parsePort(ipv6End);
    2656                 }
    2657                 m_url.m_hostEnd = currentPosition(ipv6End);
    26582656                m_url.m_portLength = 0;
    2659                 return true;
     2657                return ipv6End.atEnd();
    26602658            }
    26612659            m_url.m_hostEnd = currentPosition(ipv6End);
  • trunk/Tools/ChangeLog

    r245981 r245982  
     12019-05-31  Alex Christensen  <achristensen@webkit.org>
     2
     3        URLParser::parseHostAndPort should not allow non-port characters after an ipv6 host
     4        https://bugs.webkit.org/show_bug.cgi?id=198428
     5        <rdar://problem/51209196>
     6
     7        Reviewed by Tim Horton.
     8
     9        * TestWebKitAPI/Tests/WTF/URLParser.cpp:
     10        (TestWebKitAPI::TEST_F):
     11
    1122019-05-28  Dewei Zhu  <dewei_zhu@apple.com>
    213
  • trunk/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp

    r239461 r245982  
    12121212    shouldFail("about~");
    12131213    shouldFail("//C:asdf/foo/bar", "file:///tmp/mock/path");
     1214    shouldFail("wss://[c::]abc/");
     1215    shouldFail("abc://[c::]:abc/");
     1216    shouldFail("abc://[c::]01");
    12141217    shouldFail("http://[1234::ab#]");
    12151218    shouldFail("http://[1234::ab/]");
Note: See TracChangeset for help on using the changeset viewer.