WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
200023
Fix crashes in ScrollingStateNode::insertChild()
https://bugs.webkit.org/show_bug.cgi?id=200023
Summary
Fix crashes in ScrollingStateNode::insertChild()
Simon Fraser (smfr)
Reported
2019-07-22 18:40:26 PDT
Fix crashes in ScrollingStateNode::insertChild()
Attachments
Patch
(1.75 KB, patch)
2019-07-22 18:41 PDT
,
Simon Fraser (smfr)
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2019-07-22 18:41:50 PDT
Created
attachment 374662
[details]
Patch
Simon Fraser (smfr)
Comment 2
2019-07-22 18:41:52 PDT
<
rdar://problem/53265378
>
Darin Adler
Comment 3
2019-07-22 18:52:37 PDT
Comment on
attachment 374662
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=374662&action=review
> Source/WebCore/ChangeLog:13 > + Crash data suggest that ScrollingStateNode::insertChild() can be passed an index that > + is larger than the size of the vector, causing crashes. > + > + Fix defensively by falling back to append() if the passed index is equal to or larger > + than the size of the children vector.
Is there a reason we don’t do this inside the insert function instead? Are there other call sites where we want the stricter behavior? What about asserting the index is valid, even if we prevent the crash in such cases? That could help us some day understand how this happens if we reproduce in a build with assertions on.
Simon Fraser (smfr)
Comment 4
2019-07-23 12:50:46 PDT
https://trac.webkit.org/r247734
Darin Adler
Comment 5
2019-07-23 19:12:46 PDT
Comment on
attachment 374662
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=374662&action=review
> Source/WebCore/page/scrolling/ScrollingStateNode.cpp:119 > + if (index >= m_children->size())
The patch you landed uses ">" rather than ">=". Why is that?
Simon Fraser (smfr)
Comment 6
2019-07-23 19:42:54 PDT
(In reply to Darin Adler from
comment #5
)
> Comment on
attachment 374662
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=374662&action=review
> > > Source/WebCore/page/scrolling/ScrollingStateNode.cpp:119 > > + if (index >= m_children->size()) > > The patch you landed uses ">" rather than ">=". Why is that?
Because Vector::insert() allows inserting at index = size() - it has: ASSERT_WITH_SECURITY_IMPLICATION(position <= size());
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug