• manuk's avatar
    [Omnibox] Avoid removing the `www.` prefix during deduping when doing so would... · 7c10eab1
    manuk authored
    [Omnibox] Avoid removing the `www.` prefix during deduping when doing so would leave no host component.
    
    When sorting and deduping matches, match GURLs are stripped (`AutocompleteMatch::GURLToStrippedGURL`). Certain omnibox inputs, such as `http://www.` without inline autocomplete, produce matches with host compoments `www.`. Stripping `www.` in these cases would result in an empty url host component and, therefore, invalid `GURL`. Invoking `GURL::spec` on such invalid URLs would then cause a DCHECK to evaluate false and crash the browser. The crash only affects debug builds as the DCHECK is inactive for non-debug builds.
    
    Bug: 898554
    Change-Id: I73461c65ba53891d6f3b52bc767c754b02c1ce3e
    Reviewed-on: https://chromium-review.googlesource.com/c/1331631
    Commit-Queue: manuk hovanesian <manukh@chromium.org>
    Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#607709}
    7c10eab1
autocomplete_match.cc 30.5 KB