Changeset 94793 in webkit


Ignore:
Timestamp:
Sep 8, 2011 1:50:24 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Crashes in WebCore::ReplaceSelectionCommand::doApply
https://bugs.webkit.org/show_bug.cgi?id=67762

Patch by Shinya Kawanaka <shinyak@google.com> on 2011-09-08
Reviewed by Ryosuke Niwa.

Source/WebCore:

WebCore::enclosingBlock may return null, but its return value was not checked. This patch checks it.

Tests: editing/inserting/insert-without-enclosing-block.html

  • editing/ReplaceSelectionCommand.cpp:

(WebCore::ReplaceSelectionCommand::doApply): Added null check.

LayoutTests:

WebCore::enclosingBlock may return NULL, but its return value was not checked. This patch checks it.

  • editing/inserting/insert-without-enclosing-block-expected.txt: Added.
  • editing/inserting/insert-without-enclosing-block.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r94792 r94793  
     12011-09-08  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Crashes in WebCore::ReplaceSelectionCommand::doApply
     4        https://bugs.webkit.org/show_bug.cgi?id=67762
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        WebCore::enclosingBlock may return NULL, but its return value was not checked. This patch checks it.
     9
     10        * editing/inserting/insert-without-enclosing-block-expected.txt: Added.
     11        * editing/inserting/insert-without-enclosing-block.html: Added.
     12
    1132011-09-08  Nate Chapin  <japhet@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r94790 r94793  
     12011-09-08  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Crashes in WebCore::ReplaceSelectionCommand::doApply
     4        https://bugs.webkit.org/show_bug.cgi?id=67762
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        WebCore::enclosingBlock may return null, but its return value was not checked. This patch checks it.
     9
     10        Tests: editing/inserting/insert-without-enclosing-block.html
     11
     12        * editing/ReplaceSelectionCommand.cpp:
     13        (WebCore::ReplaceSelectionCommand::doApply): Added null check.
     14
    1152011-09-08  Sheriff Bot  <webkit.review.bot@gmail.com>
    216
  • trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp

    r93134 r94793  
    995995    Node* blockStart = enclosingBlock(insertionPos.deprecatedNode());
    996996    if ((isListElement(refNode.get()) || (isLegacyAppleStyleSpan(refNode.get()) && isListElement(refNode->firstChild())))
    997         && blockStart->renderer()->isListItem())
     997        && blockStart && blockStart->renderer()->isListItem())
    998998        refNode = insertAsListItems(refNode, blockStart, insertionPos);
    999999    else
Note: See TracChangeset for help on using the changeset viewer.