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

Changeset 285920 in webkit


Ignore:
Timestamp:
Nov 17, 2021, 1:18:30 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Null check clonedParent
https://bugs.webkit.org/show_bug.cgi?id=230713

Patch by Rob Buis <rbuis@igalia.com> on 2021-11-17
Reviewed by Wenson Hsieh.

Source/WebCore:

Null check clonedParent.

Test: editing/execCommand/insert-newline-in-quoted-content-crash.html

  • editing/BreakBlockquoteCommand.cpp:

(WebCore::BreakBlockquoteCommand::doApply):

LayoutTests:

  • editing/execCommand/insert-newline-in-quoted-content-crash-expected.txt: Added.
  • editing/execCommand/insert-newline-in-quoted-content-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r285918 r285920  
     12021-11-17  Rob Buis  <rbuis@igalia.com>
     2
     3        Null check clonedParent
     4        https://bugs.webkit.org/show_bug.cgi?id=230713
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        * editing/execCommand/insert-newline-in-quoted-content-crash-expected.txt: Added.
     9        * editing/execCommand/insert-newline-in-quoted-content-crash.html: Added.
     10
    1112021-11-16  Rob Buis  <rbuis@igalia.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r285918 r285920  
     12021-11-17  Rob Buis  <rbuis@igalia.com>
     2
     3        Null check clonedParent
     4        https://bugs.webkit.org/show_bug.cgi?id=230713
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        Null check clonedParent.
     9
     10        Test: editing/execCommand/insert-newline-in-quoted-content-crash.html
     11
     12        * editing/BreakBlockquoteCommand.cpp:
     13        (WebCore::BreakBlockquoteCommand::doApply):
     14
    1152021-11-16  Rob Buis  <rbuis@igalia.com>
    216
  • trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp

    r285195 r285920  
    169169        RefPtr<Element> clonedParent;
    170170        for (ancestor = ancestors.first(), clonedParent = clonedAncestor->parentElement();
    171              ancestor && ancestor != topBlockquote;
    172              ancestor = ancestor->parentElement(), clonedParent = clonedParent->parentElement())
     171            ancestor && ancestor != topBlockquote;
     172            ancestor = ancestor->parentElement(), clonedParent = clonedParent->parentElement()) {
     173            if (!clonedParent)
     174                break;
    173175            moveRemainingSiblingsToNewParent(ancestor->nextSibling(), 0, *clonedParent);
     176        }
    174177
    175178        // If the startNode's original parent is now empty, remove it
Note: See TracChangeset for help on using the changeset viewer.