Title: [246973] releases/WebKitGTK/webkit-2.24/Source/WebCore
Revision
246973
Author
[email protected]
Date
2019-07-01 01:53:25 -0700 (Mon, 01 Jul 2019)

Log Message

Merge r246653 - REGRESSION(r245912): Crash in TextIterator::range via visiblePositionForIndexUsingCharacterIterator
https://bugs.webkit.org/show_bug.cgi?id=199061

Reviewed by Wenson Hsieh.

Avoid calling CharacterIterator::range when it's at the end. Otherwise, we'd crash with null pointer dereferencing.

Unfortunately no new tests since we don't have any reproducible test case.

* editing/Editing.cpp:
(WebCore::visiblePositionForIndexUsingCharacterIterator):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog (246972 => 246973)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-07-01 08:53:22 UTC (rev 246972)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-07-01 08:53:25 UTC (rev 246973)
@@ -1,3 +1,17 @@
+2019-06-20  Ryosuke Niwa  <[email protected]>
+
+        REGRESSION(r245912): Crash in TextIterator::range via visiblePositionForIndexUsingCharacterIterator
+        https://bugs.webkit.org/show_bug.cgi?id=199061
+
+        Reviewed by Wenson Hsieh.
+
+        Avoid calling CharacterIterator::range when it's at the end. Otherwise, we'd crash with null pointer dereferencing.
+
+        Unfortunately no new tests since we don't have any reproducible test case.
+
+        * editing/Editing.cpp:
+        (WebCore::visiblePositionForIndexUsingCharacterIterator):
+
 2019-05-30  Andres Gonzalez  <[email protected]>
 
         Inserting a newline in contenteditable causes two characters to be added instead of one

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/editing/Editing.cpp (246972 => 246973)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/editing/Editing.cpp	2019-07-01 08:53:22 UTC (rev 246972)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/editing/Editing.cpp	2019-07-01 08:53:25 UTC (rev 246973)
@@ -1127,7 +1127,8 @@
         auto range = it.range();
         if (range->startPosition() == range->endPosition()) {
             it.advance(1);
-            return VisiblePosition(it.range()->startPosition());
+            if (!it.atEnd())
+                return VisiblePosition(it.range()->startPosition());
         }
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to