Title: [148995] trunk/Source/WebKit2
Revision
148995
Author
[email protected]
Date
2013-04-23 14:56:59 -0700 (Tue, 23 Apr 2013)

Log Message

REGRESSION(r148922): Crash opening web archives or loading web pages
https://bugs.webkit.org/show_bug.cgi?id=115061
<rdar://problem/13714228>

Reviewed by Sam Weinig.

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):
Calling ResourceLoader::didReceiveResponse can cause the WebResourceLoader object to go away,
so protect it here and guard against a null core loader.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (148994 => 148995)


--- trunk/Source/WebKit2/ChangeLog	2013-04-23 21:35:51 UTC (rev 148994)
+++ trunk/Source/WebKit2/ChangeLog	2013-04-23 21:56:59 UTC (rev 148995)
@@ -1,3 +1,16 @@
+2013-04-23  Anders Carlsson  <[email protected]>
+
+        REGRESSION(r148922): Crash opening web archives or loading web pages
+        https://bugs.webkit.org/show_bug.cgi?id=115061
+        <rdar://problem/13714228>
+
+        Reviewed by Sam Weinig.
+
+        * WebProcess/Network/WebResourceLoader.cpp:
+        (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):
+        Calling ResourceLoader::didReceiveResponse can cause the WebResourceLoader object to go away,
+        so protect it here and guard against a null core loader.
+
 2013-04-23  Tim Horton  <[email protected]>
 
         Web process crashes at WebPage::determinePrimarySnapshottedPlugInTimerFired + 8

Modified: trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp (148994 => 148995)


--- trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp	2013-04-23 21:35:51 UTC (rev 148994)
+++ trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp	2013-04-23 21:56:59 UTC (rev 148995)
@@ -102,10 +102,16 @@
 void WebResourceLoader::didReceiveResponseWithCertificateInfo(const ResourceResponse& response, const PlatformCertificateInfo& certificateInfo)
 {
     LOG(Network, "(WebProcess) WebResourceLoader::didReceiveResponseWithCertificateInfo for '%s'. Status %d.", m_coreLoader->url().string().utf8().data(), response.httpStatusCode());
+
+    RefPtr<WebResourceLoader> protector(this);
+
     ResourceResponse responseCopy(response);
     responseCopy.setCertificateChain(certificateInfo.certificateChain());
     m_coreLoader->didReceiveResponse(responseCopy);
 
+    if (!m_coreLoader)
+        return;
+
     if (m_coreLoader == m_coreLoader->documentLoader()->mainResourceLoader())
         send(Messages::NetworkResourceLoader::ContinueDidReceiveResponse());
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to