-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
heap-use-after-free in WebCore::ScrollingTreeScrollingNode::scrollbar…
…VisibilityDidChange https://bugs.webkit.org/show_bug.cgi?id=267788 <rdar://119677269> Reviewed by Chris Dumez. We register a `WebScrollerImpPairDelegateMac` with a `NSScrollerImpPair` (an AppKit class), so its lifetime is somewhat unknown. The `WebScrollerImpPairDelegateMac` references a `ScrollerPairMac` by raw pointer, which should be cleaned up by `-invalidate` but convert it to a `ThreadSafeWeakPtr<>` for safety. The larger issue is that the `ScrollerPairMac` stored a `ScrollingTreeScrollingNode` by reference, so nothing guaranteed that the `ScrollingTreeScrollingNode` outlived the `ScrollerPairMac`. Convert this to a `ThreadSafeWeakPtr<>` also. I was not able to reproduce the bug with the provided testcase. * Source/WebCore/page/scrolling/mac/ScrollerMac.mm: (WebCore::ScrollerMac::visibilityChanged): (WebCore::ScrollerMac::updateMinimumKnobLength): * Source/WebCore/page/scrolling/mac/ScrollerPairMac.h: (WebCore::ScrollerPairMac::protectedNode const): (WebCore::ScrollerPairMac::node const): Deleted. * Source/WebCore/page/scrolling/mac/ScrollerPairMac.mm: (-[WebScrollerImpPairDelegateMac contentAreaRectForScrollerImpPair:]): (-[WebScrollerImpPairDelegateMac inLiveResizeForScrollerImpPair:]): (-[WebScrollerImpPairDelegateMac scrollerImpPair:convertContentPoint:toScrollerImp:]): (-[WebScrollerImpPairDelegateMac scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]): (WebCore::ScrollerPairMac::updateValues): (WebCore::ScrollerPairMac::visibleSize const): (WebCore::ScrollerPairMac::useDarkAppearance const): (WebCore::ScrollerPairMac::scrollbarWidthStyle const): (WebCore::ScrollerPairMac::valuesForOrientation): (WebCore::ScrollerPairMac::mouseEnteredContentArea): (WebCore::ScrollerPairMac::mouseExitedContentArea): Originally-landed-as: 272448.348@safari-7618-branch (5572fc8). rdar://124555073 Canonical link: https://commits.webkit.org/276166@main
- Loading branch information
1 parent
a0ed946
commit 1e46cd5
Showing
3 changed files
with
61 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters