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

Changeset 259769 in webkit


Ignore:
Timestamp:
Apr 8, 2020, 5:38:27 PM (6 years ago)
Author:
Alan Coon
Message:

Cherry-pick r259766. rdar://problem/61487124

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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259766 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-610.1.9-branch/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610.1.9-branch/Source/WebCore/ChangeLog

    r259696 r259769  
     12020-04-08  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r259766. rdar://problem/61487124
     4
     5    REGRESSION (r258525): Occasional crashes under TextManipulationController::observeParagraphs
     6    https://bugs.webkit.org/show_bug.cgi?id=210215
     7    <rdar://problem/61362512>
     8   
     9    Reviewed by Darin Adler.
     10   
     11    In the case where `startOfParagraph` or `endOfParagraph` return a null `Position`, we end up crashing under
     12    TextManipulationController::observeParagraphs while creating `ParagraphContentIterator`, which expects non-null
     13    `Position`s because it dereferences the result of `makeBoundaryPoint`.
     14   
     15    Avoid this crash for now by bailing if either the start or end positions are null. Tests to be added in a
     16    followup patch.
     17   
     18    * editing/TextManipulationController.cpp:
     19    (WebCore::TextManipulationController::observeParagraphs):
     20   
     21   
     22    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     23
     24    2020-04-08  Wenson Hsieh  <wenson_hsieh@apple.com>
     25
     26            REGRESSION (r258525): Occasional crashes under TextManipulationController::observeParagraphs
     27            https://bugs.webkit.org/show_bug.cgi?id=210215
     28            <rdar://problem/61362512>
     29
     30            Reviewed by Darin Adler.
     31
     32            In the case where `startOfParagraph` or `endOfParagraph` return a null `Position`, we end up crashing under
     33            TextManipulationController::observeParagraphs while creating `ParagraphContentIterator`, which expects non-null
     34            `Position`s because it dereferences the result of `makeBoundaryPoint`.
     35
     36            Avoid this crash for now by bailing if either the start or end positions are null. Tests to be added in a
     37            followup patch.
     38
     39            * editing/TextManipulationController.cpp:
     40            (WebCore::TextManipulationController::observeParagraphs):
     41
    1422020-04-07  Alan Coon  <alancoon@apple.com>
    243
  • branches/safari-610.1.9-branch/Source/WebCore/editing/TextManipulationController.cpp

    r258525 r259769  
    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.