Title: [245464] trunk/Source/WebCore
Revision
245464
Author
[email protected]
Date
2019-05-17 09:03:36 -0700 (Fri, 17 May 2019)

Log Message

Hardening: Prevent FrameLoader crash due to SetForScope
https://bugs.webkit.org/show_bug.cgi?id=197458
<rdar://problem/50368338>

Reviewed by Chris Dumez.

Since SetForScope takes action during a function returns, it might cause
a crash if its scope is broader than the value it is resetting.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadDifferentDocumentItem):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (245463 => 245464)


--- trunk/Source/WebCore/ChangeLog	2019-05-17 15:20:22 UTC (rev 245463)
+++ trunk/Source/WebCore/ChangeLog	2019-05-17 16:03:36 UTC (rev 245464)
@@ -1,3 +1,17 @@
+2019-05-17  Brent Fulgham  <[email protected]>
+
+        Hardening: Prevent FrameLoader crash due to SetForScope
+        https://bugs.webkit.org/show_bug.cgi?id=197458
+        <rdar://problem/50368338>
+
+        Reviewed by Chris Dumez.
+
+        Since SetForScope takes action during a function returns, it might cause
+        a crash if its scope is broader than the value it is resetting.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadDifferentDocumentItem):
+
 2019-05-16  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Need WebKitContextMenuItemType to open emoji picker

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (245463 => 245464)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2019-05-17 15:20:22 UTC (rev 245463)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2019-05-17 16:03:36 UTC (rev 245464)
@@ -3696,6 +3696,8 @@
 {
     RELEASE_LOG_IF_ALLOWED("loadDifferentDocumentItem: frame load started (frame = %p, main = %d)", &m_frame, m_frame.isMainFrame());
 
+    Ref<Frame> protectedFrame(m_frame);
+
     // History items should not be reported to the parent.
     m_shouldReportResourceTimingToParentFrame = false;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to