Title: [267706] trunk/Source/WebCore
Revision
267706
Author
[email protected]
Date
2020-09-28 11:14:23 -0700 (Mon, 28 Sep 2020)

Log Message

REGRESSION (r267329): Crash due to null-dereference of frame pointer in DOMSelection::rangeCount
https://bugs.webkit.org/show_bug.cgi?id=217053

Reviewed by Sam Weinig.

Later as a follow-up it would be nice to add a test case, but not obvious how to
make a simple one quickly.

* page/DOMSelection.cpp:
(WebCore::DOMSelection::rangeCount const): Fixed the null check.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (267705 => 267706)


--- trunk/Source/WebCore/ChangeLog	2020-09-28 17:46:39 UTC (rev 267705)
+++ trunk/Source/WebCore/ChangeLog	2020-09-28 18:14:23 UTC (rev 267706)
@@ -1,3 +1,16 @@
+2020-09-28  Darin Adler  <[email protected]>
+
+        REGRESSION (r267329): Crash due to null-dereference of frame pointer in DOMSelection::rangeCount
+        https://bugs.webkit.org/show_bug.cgi?id=217053
+
+        Reviewed by Sam Weinig.
+
+        Later as a follow-up it would be nice to add a test case, but not obvious how to
+        make a simple one quickly.
+
+        * page/DOMSelection.cpp:
+        (WebCore::DOMSelection::rangeCount const): Fixed the null check.
+
 2020-09-28  Aditya Keerthi  <[email protected]>
 
         [macOS] Update the appearance of editable date/time controls to match the system

Modified: trunk/Source/WebCore/page/DOMSelection.cpp (267705 => 267706)


--- trunk/Source/WebCore/page/DOMSelection.cpp	2020-09-28 17:46:39 UTC (rev 267705)
+++ trunk/Source/WebCore/page/DOMSelection.cpp	2020-09-28 18:14:23 UTC (rev 267706)
@@ -188,8 +188,8 @@
 unsigned DOMSelection::rangeCount() const
 {
     auto frame = this->frame();
-    if (frame->settings().liveRangeSelectionEnabled())
-        return frame && frame->selection().isInDocumentTree();
+    if (frame && frame->settings().liveRangeSelectionEnabled())
+        return frame->selection().isInDocumentTree();
     return !frame || frame->selection().isNone() ? 0 : 1;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to