Bug 1146169 - Check mChannel for null-ness in nsIInterceptedChannel::SetSecurityInfo(); r=jdm
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 22 Mar 2015 15:42:12 -0400
changeset 263847 84dae60ceecfba156cdca3f488045447a4dcf4f2
parent 263846 675bb5164535a474815e095920a116d2407d42cc
child 263848 2b00ac18b6a06a5b947a412458c4e50e92ba34fc
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1146169
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1146169 - Check mChannel for null-ness in nsIInterceptedChannel::SetSecurityInfo(); r=jdm
netwerk/protocol/http/InterceptedChannel.cpp
--- a/netwerk/protocol/http/InterceptedChannel.cpp
+++ b/netwerk/protocol/http/InterceptedChannel.cpp
@@ -227,16 +227,20 @@ InterceptedChannelChrome::Cancel()
   nsresult rv = mChannel->AsyncAbort(NS_BINDING_ABORTED);
   NS_ENSURE_SUCCESS(rv, rv);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 InterceptedChannelChrome::SetSecurityInfo(nsISupports* aSecurityInfo)
 {
+  if (!mChannel) {
+    return NS_ERROR_FAILURE;
+  }
+
   return mChannel->OverrideSecurityInfo(aSecurityInfo);
 }
 
 InterceptedChannelContent::InterceptedChannelContent(HttpChannelChild* aChannel,
                                                      nsINetworkInterceptController* aController,
                                                      nsIStreamListener* aListener)
 : InterceptedChannelBase(aController, aChannel->IsNavigation())
 , mChannel(aChannel)
@@ -354,13 +358,17 @@ InterceptedChannelContent::Cancel()
   mChannel = nullptr;
   mStreamListener = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 InterceptedChannelContent::SetSecurityInfo(nsISupports* aSecurityInfo)
 {
+  if (!mChannel) {
+    return NS_ERROR_FAILURE;
+  }
+
   return mChannel->OverrideSecurityInfo(aSecurityInfo);
 }
 
 } // namespace net
 } // namespace mozilla