Chromium Code Reviews
DescriptionFix use after free for cached_displays_.
There is a gap between when DisplaySnapshots get freed and when
DisplayConfigurator gets an updated list of DisplaySnapshots.
DisplayChangeObserver would try to use the pointers to freed memory if
the touch input-devices changed which might crash chrome.
Erase all entries in DisplayConfigurator::cached_displays_ before the
memory is freed. It looks like DisplayConfigurator::cached_displays_ is
only used as part of either display configuration or for associating
touchscreens. There shouldn't be any other display configuration
happening between when cached_displays_ is freed and when new display
snapshots are added in DisplayConfigurator::OnConfigured(). Add a check
in DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() if
there are no display snapshots then don't do anything to avoid passing
an empty list of ManagedDisplayInfos to DisplayManager.
BUG=669226
Committed: https://crrev.com/3f0ff6fe910fd0a4bbf487a9e411148fee83521d
Cr-Commit-Position: refs/heads/master@{#438518}
Patch Set 1 #Patch Set 2 : Add invalidate to tests. #Messages
Total messages: 19 (11 generated)
|