Chromium Code Reviews
Descriptionash: fix multiple stack-use-after-scope issues with GetPrimaryDisplay use.
The common pattern is to save a reference to the display work area
into a local variable, but the reference is to the stack allocated Display
object that goes out of scope immediately after taking the reference.
The remedy is to have |work_area| as a proper variable. For example:
const gfx::Rect& work_area =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
becomes
const gfx::Rect work_area =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
The bug was found by AddressSanitizer with use-after-free check
enabled. It's currently being rolled out into Chrome, and this CL
is a part of a larger cleanup of existing failures.
BUG=649897
Review-Url: https://codereview.chromium.org/2643853003
Cr-Commit-Position: refs/heads/master@{#444823}
Committed: https://chromium.googlesource.com/chromium/src/+/191d9a603c5b154dcf3ba8efeeb632cd80c4e411
Patch Set 1 #
Total comments: 4
Patch Set 2 : sync & address a comment. #Patch Set 3 : one more test case fixed #
Messages
Total messages: 16 (8 generated)
|
|||||||||||||||||||||||||||||||||||||