[omnibox] Fix crash from logging selected_index == kNoMatch (-1)
This CL made it much more likely that OmniboxPopupModel::selected_line() could return kNoMatch (-1): https://chromium-review.googlesource.com/c/chromium/src/+/1906882 But when we put kNoMatch into a size_t index, we get the maximum value size_t, i.e. 0xffffffff. That just overruns the results array and reads garbage memory. Instead we should ignore the popup when we are selecting a match that's not from the popup (no default match case). This CL does that, and adds a DCHECK to OmniboxLog to prevent this from happening again. Bug: 1034946 Change-Id: I989c139c9a9b9525555424987124627130f0a5d1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1989517Reviewed-by:Justin Donnelly <jdonnelly@chromium.org> Commit-Queue: Tommy Li <tommycli@chromium.org> Cr-Commit-Position: refs/heads/master@{#729801}
Showing
Please register or sign in to comment