Chromium Code Reviews
DescriptionMac: Fix lifetime problem under BookmarkBarController stopPulsingBookmarkNode.
BookmarkBarController has a weak pointer in a |pulsingButton_| data
member. This is an NSView which can be destroyed in
-[BookmarkBarController redistributeButtonsOnBarAsNeeded] when it is
removed from its superview.
Since bubbles close asynchronously, and fade out, the bookmark bubble
can cause a UAF to |pulsingButton_| via stopPulsingBookmarkNode. This
can occur if a resize triggers redistributeButtonsOnBarAsNeeded while a
bookmark bubble is still alive.
There's no need for this to be a weak pointer. Make it scoped_nsobject
instead.
This affects both Cocoa and MacViews.
BUG=616051
TEST=Added unit_test:
BookmarkBarControllerTest.RedistributeButtonsOnBarAsNeeded
Committed: https://crrev.com/561b5ae646d076efe21e2cc759b6d97ebb04ab0d
Cr-Commit-Position: refs/heads/master@{#437954}
Patch Set 1 #Patch Set 2 : Guarantee a crash #
Messages
Total messages: 19 (14 generated)
|
|||||||||||||||||||||||||||||||||||||