• David Van Cleve's avatar
    URLPattern: Correctly reject pathless candidates · ec5bd116
    David Van Cleve authored
    A recent change (5f37444e) to GURL::PathForRequest
    led to some crashes caused by URLPattern calling PathForRequest
    with invalid URLs, which was explicitly prohibited with a DCHECK
    prior to the change but, in release builds, had been silently
    accepted.
    
    This change makes URLPattern only call GURL::PathForRequest with
    valid input, by failing URLPattern::MatchesURL on pathless inputs
    prior to the call to PathForRequest.
    
    Test: Added a regression test.
    
    Bug: 1022771
    Change-Id: I52896977b6474603d30cbea99ebb776eb3ccf308
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1906511
    Commit-Queue: David Van Cleve <davidvc@chromium.org>
    Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
    Auto-Submit: David Van Cleve <davidvc@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#715320}
    ec5bd116
url_pattern.h 11.6 KB