⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285813 in webkit


Ignore:
Timestamp:
Nov 15, 2021, 10:56:59 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

nullptr deref in CompositeEditCommand::insertNodeAt
https://bugs.webkit.org/show_bug.cgi?id=232837

Patch by Gabriel Nava Marino <gnavamarino@apple.com> on 2021-11-15
Reviewed by Wenson Hsieh and Darin Adler.

Source/WebCore:

Check endingSelection is not orphan before inserting nodes at
the start position.

Test: fast/editing/editing-position-crash.html

  • editing/CreateLinkCommand.cpp:

(WebCore::CreateLinkCommand::doApply):

LayoutTests:

  • fast/editing/editing-position-crash-expected.txt: Added.
  • fast/editing/editing-position-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r285805 r285813  
     12021-11-15  Gabriel Nava Marino  <gnavamarino@apple.com>
     2
     3        nullptr deref in CompositeEditCommand::insertNodeAt
     4        https://bugs.webkit.org/show_bug.cgi?id=232837
     5
     6        Reviewed by Wenson Hsieh and Darin Adler.
     7
     8        * fast/editing/editing-position-crash-expected.txt: Added.
     9        * fast/editing/editing-position-crash.html: Added.
     10
    1112021-11-15  Tyler Wilcock  <tyler_w@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r285810 r285813  
     12021-11-15  Gabriel Nava Marino  <gnavamarino@apple.com>
     2
     3        nullptr deref in CompositeEditCommand::insertNodeAt
     4        https://bugs.webkit.org/show_bug.cgi?id=232837
     5
     6        Reviewed by Wenson Hsieh and Darin Adler.
     7
     8        Check endingSelection is not orphan before inserting nodes at
     9        the start position.
     10
     11        Test: fast/editing/editing-position-crash.html
     12
     13        * editing/CreateLinkCommand.cpp:
     14        (WebCore::CreateLinkCommand::doApply):
     15
    1162021-11-15  Andreu Botella  <andreu@andreubotella.com>
    217
  • trunk/Source/WebCore/editing/CreateLinkCommand.cpp

    r266557 r285813  
    4141void CreateLinkCommand::doApply()
    4242{
    43     if (endingSelection().isNone())
     43    if (endingSelection().isNoneOrOrphaned())
    4444        return;
    45        
     45
    4646    auto anchorElement = HTMLAnchorElement::create(document());
    4747    anchorElement->setHref(m_url);
Note: See TracChangeset for help on using the changeset viewer.