Title: [259769] branches/safari-610.1.9-branch/Source/WebCore
Revision
259769
Author
[email protected]
Date
2020-04-08 17:38:27 -0700 (Wed, 08 Apr 2020)

Log 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
    `Position`s 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

Modified Paths

Diff

Modified: branches/safari-610.1.9-branch/Source/WebCore/ChangeLog (259768 => 259769)


--- branches/safari-610.1.9-branch/Source/WebCore/ChangeLog	2020-04-09 00:20:13 UTC (rev 259768)
+++ branches/safari-610.1.9-branch/Source/WebCore/ChangeLog	2020-04-09 00:38:27 UTC (rev 259769)
@@ -1,3 +1,44 @@
+2020-04-08  Alan Coon  <[email protected]>
+
+        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
+    `Position`s 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
+
+    2020-04-08  Wenson Hsieh  <[email protected]>
+
+            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
+            `Position`s 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):
+
 2020-04-07  Alan Coon  <[email protected]>
 
         Cherry-pick r259650. rdar://problem/61419505

Modified: branches/safari-610.1.9-branch/Source/WebCore/editing/TextManipulationController.cpp (259768 => 259769)


--- branches/safari-610.1.9-branch/Source/WebCore/editing/TextManipulationController.cpp	2020-04-09 00:20:13 UTC (rev 259768)
+++ branches/safari-610.1.9-branch/Source/WebCore/editing/TextManipulationController.cpp	2020-04-09 00:38:27 UTC (rev 259769)
@@ -239,6 +239,9 @@
 
 void TextManipulationController::observeParagraphs(const Position& start, const Position& end)
 {
+    if (start.isNull() || end.isNull())
+        return;
+
     auto document = makeRefPtr(start.document());
     ASSERT(document);
     ParagraphContentIterator iterator { start, end };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to