Changeset 276186 in webkit
- Timestamp:
- Apr 16, 2021, 5:57:21 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/execCommand/remove-node-during-command-crash-expected.txt (added)
-
LayoutTests/editing/execCommand/remove-node-during-command-crash.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/editing/DeleteSelectionCommand.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r276182 r276186 1 2021-04-16 Ian Gilbert <iang@apple.com> 2 3 Nullptr deref in CompositeEditCommand::isRemovableBlock in DeleteSelectionCommand::removeRedundantBlocks 4 https://bugs.webkit.org/show_bug.cgi?id=224518 5 6 Reviewed by Ryosuke Niwa. 7 8 Add a regression test. 9 10 * editing/execCommand/remove-node-during-command-crash-expected.txt: Added. 11 * editing/execCommand/remove-node-during-command-crash.html: Added. 12 1 13 2021-04-16 Cameron McCormack <heycam@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r276182 r276186 1 2021-04-16 Ian Gilbert <iang@apple.com> 2 3 Nullptr deref in CompositeEditCommand::isRemovableBlock in DeleteSelectionCommand::removeRedundantBlocks 4 https://bugs.webkit.org/show_bug.cgi?id=224518 5 6 Reviewed by Ryosuke Niwa. 7 8 Add null check in case node is removed while iterating over tree. 9 10 Test: editing/execCommand/remove-node-during-command-crash.html 11 12 * editing/DeleteSelectionCommand.cpp: 13 (WebCore::DeleteSelectionCommand::removeRedundantBlocks): 14 1 15 2021-04-16 Cameron McCormack <heycam@apple.com> 2 16 -
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
r273866 r276186 866 866 void DeleteSelectionCommand::removeRedundantBlocks() 867 867 { 868 Node* node = m_endingPosition.containerNode();869 Node* rootNode = node->rootEditableElement();868 auto node = makeRefPtr(m_endingPosition.containerNode()); 869 auto rootNode = makeRefPtr(node->rootEditableElement()); 870 870 871 while (node != rootNode) {872 if (isRemovableBlock(node )) {871 while (node && node != rootNode) { 872 if (isRemovableBlock(node.get())) { 873 873 if (node == m_endingPosition.anchorNode()) 874 874 updatePositionForNodeRemovalPreservingChildren(m_endingPosition, *node);
Note:
See TracChangeset
for help on using the changeset viewer.