Changeset 259766 in webkit


Ignore:
Timestamp:
Apr 8, 2020 4:59:31 PM (4 years ago)
Author:
Wenson Hsieh
Message:

REGRESSION (r258525): Occasional crashes under TextManipulationController::observeParagraphs
https://bugs.webkit.org/show_bug.cgi?id=210215
<rdar://problem/61362512>

Reviewed by Darin Adler.

In the case where startOfParagraph or endOfParagraph return a null Position, we end up crashing under
TextManipulationController::observeParagraphs while creating ParagraphContentIterator, which expects non-null
Positions because it dereferences the result of makeBoundaryPoint.

Avoid this crash for now by bailing if either the start or end positions are null. Tests to be added in a
followup patch.

  • editing/TextManipulationController.cpp:

(WebCore::TextManipulationController::observeParagraphs):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r259764 r259766  
     12020-04-08  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        REGRESSION (r258525): Occasional crashes under TextManipulationController::observeParagraphs
     4        https://bugs.webkit.org/show_bug.cgi?id=210215
     5        <rdar://problem/61362512>
     6
     7        Reviewed by Darin Adler.
     8
     9        In the case where `startOfParagraph` or `endOfParagraph` return a null `Position`, we end up crashing under
     10        TextManipulationController::observeParagraphs while creating `ParagraphContentIterator`, which expects non-null
     11        `Position`s because it dereferences the result of `makeBoundaryPoint`.
     12
     13        Avoid this crash for now by bailing if either the start or end positions are null. Tests to be added in a
     14        followup patch.
     15
     16        * editing/TextManipulationController.cpp:
     17        (WebCore::TextManipulationController::observeParagraphs):
     18
    1192020-04-08  Kenneth Russell  <kbr@chromium.org>
    220
  • trunk/Source/WebCore/editing/TextManipulationController.cpp

    r259647 r259766  
    240240void TextManipulationController::observeParagraphs(const Position& start, const Position& end)
    241241{
     242    if (start.isNull() || end.isNull())
     243        return;
     244
    242245    auto document = makeRefPtr(start.document());
    243246    ASSERT(document);
Note: See TracChangeset for help on using the changeset viewer.