Title: [234373] branches/safari-606-branch/Source/WebKit
Revision
234373
Author
[email protected]
Date
2018-07-30 10:16:26 -0700 (Mon, 30 Jul 2018)

Log Message

Cherry-pick r234369. rdar://problem/42736179

    Potential null dereference under WebPage::applicationDidBecomeActive()
    https://bugs.webkit.org/show_bug.cgi?id=188170
    <rdar://problem/37493418>

    Reviewed by Wenson Hsieh.

    WebPage::m_page gets nulled out when the page is closed but the WebPage object may receive IPC
    until it gets destroyed. Therefore, we need to null-check m_page before using it in IPC message
    handlers.

    * WebProcess/WebPage/ios/WebPageIOS.mm:
    (WebKit::WebPage::applicationDidEnterBackground):
    (WebKit::WebPage::applicationWillEnterForeground):
    (WebKit::WebPage::applicationDidBecomeActive):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234369 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-606-branch/Source/WebKit/ChangeLog (234372 => 234373)


--- branches/safari-606-branch/Source/WebKit/ChangeLog	2018-07-30 17:16:22 UTC (rev 234372)
+++ branches/safari-606-branch/Source/WebKit/ChangeLog	2018-07-30 17:16:26 UTC (rev 234373)
@@ -1,3 +1,42 @@
+2018-07-30  Babak Shafiei  <[email protected]>
+
+        Cherry-pick r234369. rdar://problem/42736179
+
+    Potential null dereference under WebPage::applicationDidBecomeActive()
+    https://bugs.webkit.org/show_bug.cgi?id=188170
+    <rdar://problem/37493418>
+    
+    Reviewed by Wenson Hsieh.
+    
+    WebPage::m_page gets nulled out when the page is closed but the WebPage object may receive IPC
+    until it gets destroyed. Therefore, we need to null-check m_page before using it in IPC message
+    handlers.
+    
+    * WebProcess/WebPage/ios/WebPageIOS.mm:
+    (WebKit::WebPage::applicationDidEnterBackground):
+    (WebKit::WebPage::applicationWillEnterForeground):
+    (WebKit::WebPage::applicationDidBecomeActive):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-30  Chris Dumez  <[email protected]>
+
+            Potential null dereference under WebPage::applicationDidBecomeActive()
+            https://bugs.webkit.org/show_bug.cgi?id=188170
+            <rdar://problem/37493418>
+
+            Reviewed by Wenson Hsieh.
+
+            WebPage::m_page gets nulled out when the page is closed but the WebPage object may receive IPC
+            until it gets destroyed. Therefore, we need to null-check m_page before using it in IPC message
+            handlers.
+
+            * WebProcess/WebPage/ios/WebPageIOS.mm:
+            (WebKit::WebPage::applicationDidEnterBackground):
+            (WebKit::WebPage::applicationWillEnterForeground):
+            (WebKit::WebPage::applicationDidBecomeActive):
+
 2018-07-29  Babak Shafiei  <[email protected]>
 
         Cherry-pick r234349. rdar://problem/42721129

Modified: branches/safari-606-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (234372 => 234373)


--- branches/safari-606-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2018-07-30 17:16:22 UTC (rev 234372)
+++ branches/safari-606-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2018-07-30 17:16:26 UTC (rev 234373)
@@ -2788,7 +2788,8 @@
     m_isSuspendedUnderLock = isSuspendedUnderLock;
     setLayerTreeStateIsFrozen(true);
 
-    m_page->applicationDidEnterBackground();
+    if (m_page)
+        m_page->applicationDidEnterBackground();
 }
 
 void WebPage::applicationDidFinishSnapshottingAfterEnteringBackground()
@@ -2804,13 +2805,15 @@
 
     [[NSNotificationCenter defaultCenter] postNotificationName:WebUIApplicationWillEnterForegroundNotification object:nil userInfo:@{@"isSuspendedUnderLock": @(isSuspendedUnderLock)}];
 
-    m_page->applicationWillEnterForeground();
+    if (m_page)
+        m_page->applicationWillEnterForeground();
 }
 
 void WebPage::applicationDidBecomeActive()
 {
     [[NSNotificationCenter defaultCenter] postNotificationName:WebUIApplicationDidBecomeActiveNotification object:nil];
-    m_page->applicationDidBecomeActive();
+    if (m_page)
+        m_page->applicationDidBecomeActive();
 }
 
 static inline void adjustVelocityDataForBoundedScale(double& horizontalVelocity, double& verticalVelocity, double& scaleChangeRate, double exposedRectScale, double minimumScale, double maximumScale)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to