Changeset 224202 in webkit


Ignore:
Timestamp:
Oct 30, 2017, 2:55:28 PM (7 years ago)
Author:
achristensen@apple.com
Message:

ASSERTION FAILED: internalValuesConsistent(m_url) in WebCore::URLParser::URLParser
https://bugs.webkit.org/show_bug.cgi?id=178861

Reviewed by Tim Horton.

Source/WebCore:

This is a dark corner of the URL spec that has wildly different behavior in different browsers.
The assertion fired when we have a file URL with a ? or a # after file:// and it was because
m_pathAfterLastSlash was still 0. We definitely shouldn't assert. I'm making us consistent with
other cases where we have nothing there and add an implied missing slash.

Covered by new API tests.

  • platform/URLParser.cpp:

(WebCore::URLParser::parse):

Tools:

  • TestWebKitAPI/Tests/WebCore/URLParser.cpp:

(TestWebKitAPI::TEST_F):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r224201 r224202  
     12017-10-30  Alex Christensen  <achristensen@webkit.org>
     2
     3        ASSERTION FAILED: internalValuesConsistent(m_url) in WebCore::URLParser::URLParser
     4        https://bugs.webkit.org/show_bug.cgi?id=178861
     5
     6        Reviewed by Tim Horton.
     7
     8        This is a dark corner of the URL spec that has wildly different behavior in different browsers.
     9        The assertion fired when we have a file URL with a ? or a # after file:// and it was because
     10        m_pathAfterLastSlash was still 0. We definitely shouldn't assert. I'm making us consistent with
     11        other cases where we have nothing there and add an implied missing slash.
     12       
     13        Covered by new API tests.
     14
     15        * platform/URLParser.cpp:
     16        (WebCore::URLParser::parse):
     17
    1182017-10-27  Megan Gardner  <megan_gardner@apple.com>
    219
  • trunk/Source/WebCore/platform/URLParser.cpp

    r221677 r224202  
    17291729        case State::PathStart:
    17301730            LOG_STATE("PathStart");
    1731             if (*c != '/' && *c != '\\')
    1732                 ++c;
     1731            if (*c != '/' && *c != '\\') {
     1732                syntaxViolation(c);
     1733                appendToASCIIBuffer('/');
     1734            }
     1735            m_url.m_pathAfterLastSlash = currentPosition(c);
    17331736            state = State::Path;
    17341737            break;
  • trunk/Tools/ChangeLog

    r224198 r224202  
     12017-10-30  Alex Christensen  <achristensen@webkit.org>
     2
     3        ASSERTION FAILED: internalValuesConsistent(m_url) in WebCore::URLParser::URLParser
     4        https://bugs.webkit.org/show_bug.cgi?id=178861
     5
     6        Reviewed by Tim Horton.
     7
     8        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
     9        (TestWebKitAPI::TEST_F):
     10
    1112017-10-30  Commit Queue  <commit-queue@webkit.org>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp

    r219076 r224202  
    362362    checkURL("file:////?query", {"file", "", "", "", 0, "//", "query", "", "file:////?query"});
    363363    checkURL("file:////#fragment", {"file", "", "", "", 0, "//", "", "fragment", "file:////#fragment"});
     364    checkURL("file://?Q", {"file", "", "", "", 0, "/", "Q", "", "file:///?Q"});
     365    checkURL("file://#F", {"file", "", "", "", 0, "/", "", "F", "file:///#F"});
     366    checkURL("file://host?Q", {"file", "", "", "host", 0, "/", "Q", "", "file://host/?Q"});
     367    checkURL("file://host#F", {"file", "", "", "host", 0, "/", "", "F", "file://host/#F"});
     368    checkURL("file://host\\P", {"file", "", "", "host", 0, "/P", "", "", "file://host/P"});
     369    checkURL("file://host\\?Q", {"file", "", "", "host", 0, "/", "Q", "", "file://host/?Q"});
     370    checkURL("file://host\\../P", {"file", "", "", "host", 0, "/P", "", "", "file://host/P"});
     371    checkURL("file://host\\/../P", {"file", "", "", "host", 0, "/P", "", "", "file://host/P"});
     372    checkURL("file://host\\/P", {"file", "", "", "host", 0, "//P", "", "", "file://host//P"});
    364373    checkURL("http://host/A b", {"http", "", "", "host", 0, "/A%20b", "", "", "http://host/A%20b"});
    365374    checkURL("http://host/a%20B", {"http", "", "", "host", 0, "/a%20B", "", "", "http://host/a%20B"});
Note: See TracChangeset for help on using the changeset viewer.