Certain NetworkResourceLoader callbacks can deref a null m_networkLoad.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2016 03:19:20 +0000 (03:19 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2016 03:19:20 +0000 (03:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=158134

Reviewed by Alex Christensen.

It's legit for m_networkLoad to be null in these callbacks.

We need null checks, just like we have in many other callbacks in this class.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRequest):
(WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace):

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

Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp

index ba68156..4b756e3 100644 (file)
@@ -1,3 +1,18 @@
+2016-05-26  Brady Eidson  <beidson@apple.com>
+
+        Certain NetworkResourceLoader callbacks can deref a null m_networkLoad.
+        https://bugs.webkit.org/show_bug.cgi?id=158134
+
+        Reviewed by Alex Christensen.
+
+        It's legit for m_networkLoad to be null in these callbacks.
+        
+        We need null checks, just like we have in many other callbacks in this class.
+        
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::continueWillSendRequest):
+        (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace):
+
 2016-05-26  Darin Adler  <darin@apple.com>
 
         Media queries and platform screen modernization and streamlining
index d268597..ff61eda 100644 (file)
@@ -454,7 +454,9 @@ void NetworkResourceLoader::continueWillSendRequest(const ResourceRequest& newRe
         return;
     }
 #endif
-    m_networkLoad->continueWillSendRequest(newRequest);
+
+    if (m_networkLoad)
+        m_networkLoad->continueWillSendRequest(newRequest);
 }
 
 void NetworkResourceLoader::continueDidReceiveResponse()
@@ -642,7 +644,8 @@ void NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync(const Pro
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
 void NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace(bool result)
 {
-    m_networkLoad->continueCanAuthenticateAgainstProtectionSpace(result);
+    if (m_networkLoad)
+        m_networkLoad->continueCanAuthenticateAgainstProtectionSpace(result);
 }
 #endif