Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Correct nullptr deref in selection handling.
https://bugs.webkit.org/show_bug.cgi?id=178189 <rdar://problem/33833012> Reviewed by Ryosuke Niwa. The VisibleSelection::toNormalizedRange returns nullptr for certain conditions (e.g., 'isNone' and 'isOrphaned' cases). It's possible to crash the WebProcess by executing a code path with an orphaned selection range. The return value of 'toNormalizedRange' is checked for nullptr in many places, but not everywhere. This patch adds those missing nullptr checks. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss): * editing/EditingStyle.cpp: (WebCore::EditingStyle::styleAtSelectionStart): * editing/Editor.cpp: (WebCore::Editor::misspelledWordAtCaretOrRange const): * page/DOMSelection.cpp: (WebCore::DOMSelection::containsNode const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): Canonical link: https://commits.webkit.org/194455@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
3a70f4c
commit 821eddc30d13736ce3bd1ab884c39fd967cb2bf9
Showing
7 changed files
with
42 additions
and
4 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
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
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