Changeset 269137 in webkit
- Timestamp:
- Oct 28, 2020, 10:26:10 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/deleting/move-paragraph-crash-expected.txt (added)
-
LayoutTests/editing/deleting/move-paragraph-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/editing/CompositeEditCommand.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r269136 r269137 1 2020-10-28 Julian Gonzalez <julian_a_gonzalez@apple.com> 2 3 Null dereference in CompositeEditCommand::cloneParagraphUnderNewElement() due to not checking for top of DOM tree 4 https://bugs.webkit.org/show_bug.cgi?id=218132 5 6 Reviewed by Ryosuke Niwa. 7 8 Add a test to verify that we don't iterate outside the DOM tree while cloning a paragraph. 9 Thanks to Ryosuke Niwa for helping minimize the test and make it more stable. 10 11 * editing/deleting/move-paragraph-crash-expected.txt: Added. 12 * editing/deleting/move-paragraph-crash.html: Added. 13 1 14 2020-10-28 Ryosuke Niwa <rniwa@webkit.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r269136 r269137 1 2020-10-28 Julian Gonzalez <julian_a_gonzalez@apple.com> 2 3 Null dereference in CompositeEditCommand::cloneParagraphUnderNewElement() due to not checking for top of DOM tree 4 https://bugs.webkit.org/show_bug.cgi?id=218132 5 6 Reviewed by Ryosuke Niwa. 7 8 When iterating through parent nodes, cloneParagraphUnderNewElement() 9 has to be careful to check for the top of the DOM tree (where 10 parentNode() returns nullptr) and stop iterating. 11 12 * editing/CompositeEditCommand.cpp: 13 (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement): 14 1 15 2020-10-28 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r267363 r269137 1269 1269 // find the first common ancestor to increase the scope 1270 1270 // of our nextSibling traversal. 1271 while (!end.deprecatedNode()->isDescendantOf(outerNode.get()) ) {1271 while (!end.deprecatedNode()->isDescendantOf(outerNode.get()) && outerNode->parentNode()) { 1272 1272 outerNode = outerNode->parentNode(); 1273 1273 } … … 1278 1278 // tree by NodeTraversal::nextSkippingChildren, so that the relative depth between 1279 1279 // node and the original start node is maintained in the clone. 1280 while (startNode->parentNode() != node->parentNode()) {1280 while (startNode->parentNode() && startNode->parentNode() != node->parentNode()) { 1281 1281 startNode = startNode->parentNode(); 1282 1282 lastNode = lastNode->parentNode(); 1283 ASSERT(lastNode); 1283 1284 } 1284 1285
Note:
See TracChangeset
for help on using the changeset viewer.