Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Issue 2036193003: Fix null pointer dereference in FocusManager::ViewRemoved. (Closed)

Created:
4 years, 6 months ago by krasin
Modified:
4 years, 6 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, kcc2, pcc1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix null pointer dereference in FocusManager::ViewRemoved. Turns out that FocusManager::ViewRemoved could be called with NULL as the argument. Right now, the code will happily derefence the null pointer and call a method, which is undefined behavior in C++. BUG=617305

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M ui/views/focus/focus_manager.cc View 1 chunk +1 line, -1 line 1 comment Download

Messages

Total messages: 4 (1 generated)
krasin
4 years, 6 months ago (2016-06-03 22:47:39 UTC) #2
sky
https://codereview.chromium.org/2036193003/diff/1/ui/views/focus/focus_manager.cc File ui/views/focus/focus_manager.cc (right): https://codereview.chromium.org/2036193003/diff/1/ui/views/focus/focus_manager.cc#newcode520 ui/views/focus/focus_manager.cc:520: if (focused_view_ && removed && removed->Contains(focused_view_)) This code shouldn't ...
4 years, 6 months ago (2016-06-06 16:30:46 UTC) #3
krasin
4 years, 6 months ago (2016-06-08 05:18:37 UTC) #4
Closing this issue in favor of slightly more through fix:
https://codereview.chromium.org/2047083002/
Still not ideal, as I don't fully understand the chain of the events, but the
fix feels future proof: if we ever get this condition again, the DCHECK will
warn us.

Powered by Google App Engine
This is Rietveld 408576698