Changeset 225186 in webkit


Ignore:
Timestamp:
Nov 27, 2017 12:23:13 PM (6 years ago)
Author:
achristensen@apple.com
Message:

imported/w3c/web-platform-tests/url/failure.html crashes on debug builds
https://bugs.webkit.org/show_bug.cgi?id=172337

Reviewed by Chris Dumez.

There were two problems:

  1. Invalid URLs can contain non-ASCII characters in its UTF8 representation.

We should not put these URLs into content extension finite state machines. They won't load anyways.

  1. If we don't have any content extensions installed, we still call String.utf8 unnecessarily. Let's not.
  • contentextensions/ContentExtensionsBackend.cpp:

(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r225185 r225186  
     12017-11-27  Alex Christensen  <achristensen@webkit.org>
     2
     3        imported/w3c/web-platform-tests/url/failure.html crashes on debug builds
     4        https://bugs.webkit.org/show_bug.cgi?id=172337
     5
     6        Reviewed by Chris Dumez.
     7
     8        There were two problems:
     9        1. Invalid URLs can contain non-ASCII characters in its UTF8 representation.
     10        We should not put these URLs into content extension finite state machines.  They won't load anyways.
     11        2. If we don't have any content extensions installed, we still call String.utf8 unnecessarily.  Let's not.
     12
     13        * contentextensions/ContentExtensionsBackend.cpp:
     14        (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
     15
    1162017-11-27  Simon Fraser  <simon.fraser@apple.com>
    217
  • trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp

    r225117 r225186  
    7777    double addedTimeStart = monotonicallyIncreasingTime();
    7878#endif
    79     if (resourceLoadInfo.resourceURL.protocolIsData())
     79    if (m_contentExtensions.isEmpty()
     80        || !resourceLoadInfo.resourceURL.isValid()
     81        || resourceLoadInfo.resourceURL.protocolIsData())
    8082        return { };
    8183
    8284    const String& urlString = resourceLoadInfo.resourceURL.string();
    8385    ASSERT_WITH_MESSAGE(urlString.isAllASCII(), "A decoded URL should only contain ASCII characters. The matching algorithm assumes the input is ASCII.");
    84     const CString& urlCString = urlString.utf8();
     86    const auto urlCString = urlString.utf8();
    8587
    8688    Vector<Action> finalActions;
Note: See TracChangeset for help on using the changeset viewer.