| Summary: | Nullptr crash in CompositeEditCommand::moveParagraphWithClones when indenting non-enclosed elements. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jack <shihchieh_lee> | ||||||||
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | bfulgham, commit-queue, ews-feeder, product-security, rniwa, webkit-bug-importer, wenson_hsieh | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | WebKit Nightly Build | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Jack
2020-03-05 00:29:19 PST
Root cause: In function IndentOutdentCommand::indentIntoBlockquote, startOfContents is the parent of end and outerBlock, causing unexpected behavior in function CompositeEditCommand::cloneParagraphUnderNewElement. In function cloneParagraphUnderNewElement, when outerBlock is not an ancestor of startOfContents, node traversal above the editable element, causing insertion of the cloned node to fail and the makes the node parentless. Later we try to insert another node to the parent of the cloned node, which is null, resulting in nullptr dereference. Created attachment 392547 [details]
Patch
Created attachment 392548 [details]
Patch
Comment on attachment 392548 [details]
Patch
[121/1819] editing/execCommand/4641880-2.html failed unexpectedly (text diff)
stopping WebKitTestRunner(pid 51788) timed out, killing it
[391/1819] editing/execCommand/5481523.html failed unexpectedly (text diff)
[491/1819] editing/execCommand/5658933-1.html failed unexpectedly (text diff)
[509/1819] editing/execCommand/5658933-2.html failed unexpectedly (text diff)
[519/1819] editing/execCommand/5658933-3.html failed unexpectedly (text diff)
[898/1819] editing/execCommand/indent-div-inside-list.html failed unexpectedly (text diff)
[909/1819] editing/execCommand/indent-images-2.html failed unexpectedly (text diff)
[917/1819] editing/execCommand/indent-images.html failed unexpectedly (text diff)
[923/1819] editing/execCommand/indent-img-twice.html failed unexpectedly (text diff)
Created attachment 392552 [details]
Patch
Ran tests in LayoutTests/editing: 1815 tests ran as expected, 4 didn't: Expected to fail, but passed: (4) editing/mac/selection/context-menu-select-editability.html editing/spelling/spelling-marker-includes-hyphen.html editing/spelling/spelling-markers-in-overlapping-lines-large-font.html editing/spelling/spelling-markers-in-overlapping-lines.html (In reply to Jack from comment #5) > Created attachment 392552 [details] > Patch The modified function is not called in the two failed test cases. fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html fast/scrolling/scroll-animator-overlay-scrollbars-hovered.html Comment on attachment 392552 [details]
Patch
Looks sane to me.
This is not a security bug. Comment on attachment 392552 [details] Patch Clearing flags on attachment: 392552 Committed r258239: <https://trac.webkit.org/changeset/258239> All reviewed patches have been landed. Closing bug. |