Title: [245653] trunk/Source/WebKit
Revision
245653
Author
[email protected]
Date
2019-05-22 15:32:06 -0700 (Wed, 22 May 2019)

Log Message

Crash in WebFrame::jsContext() when m_coreFrame is null
https://bugs.webkit.org/show_bug.cgi?id=198067

Reviewed by Alex Christensen.

Added missing null checks. Unfortunately no new tests since we don't have a reproducible test case.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::jsContext):
(WebKit::WebFrame::jsContextForWorld):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (245652 => 245653)


--- trunk/Source/WebKit/ChangeLog	2019-05-22 22:19:38 UTC (rev 245652)
+++ trunk/Source/WebKit/ChangeLog	2019-05-22 22:32:06 UTC (rev 245653)
@@ -1,3 +1,16 @@
+2019-05-22  Ryosuke Niwa  <[email protected]>
+
+        Crash in WebFrame::jsContext() when m_coreFrame is null
+        https://bugs.webkit.org/show_bug.cgi?id=198067
+
+        Reviewed by Alex Christensen.
+
+        Added missing null checks. Unfortunately no new tests since we don't have a reproducible test case.
+
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::jsContext):
+        (WebKit::WebFrame::jsContextForWorld):
+
 2019-05-22  Sihui Liu  <[email protected]>
 
         API Test landed in r245540 [Mac WK2] TestWebKitAPI.WKWebView.LocalStorageProcessCrashes is a flaky failure

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp (245652 => 245653)


--- trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp	2019-05-22 22:19:38 UTC (rev 245652)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp	2019-05-22 22:32:06 UTC (rev 245653)
@@ -520,11 +520,17 @@
 
 JSGlobalContextRef WebFrame::jsContext()
 {
+    if (!m_coreFrame)
+        return nullptr;
+
     return toGlobalRef(m_coreFrame->script().globalObject(mainThreadNormalWorld())->globalExec());
 }
 
 JSGlobalContextRef WebFrame::jsContextForWorld(InjectedBundleScriptWorld* world)
 {
+    if (!m_coreFrame)
+        return nullptr;
+
     return toGlobalRef(m_coreFrame->script().globalObject(world->coreWorld())->globalExec());
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to