Bug 1546191 - Add a null-check for listener call in nsCORSListenerProxy::OnStopRequest to prevent a null-dereference crash on all Fennec channels. r=michal, a=RyanVM
authorHonza Bambas <honzab.moz@firemni.cz>
Thu, 01 Jan 1970 00:00:00 +0000
changeset 524562 62b886edff5f0d4f505ae4d9dc16fada8a9d1561
parent 524561 4b5295ee52ab0e6d0a180ecb88f0e9ea4638facd
child 524563 2cf9e0c91d519a73e726739e98c8befa08a72893
push id869
push userryanvm@gmail.com
push dateThu, 13 Feb 2020 20:08:46 +0000
treeherdermozilla-esr68@2cf9e0c91d51 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal, RyanVM
bugs1546191
milestone68.6.0
Bug 1546191 - Add a null-check for listener call in nsCORSListenerProxy::OnStopRequest to prevent a null-dereference crash on all Fennec channels. r=michal, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D62615
netwerk/protocol/http/nsCORSListenerProxy.cpp
--- a/netwerk/protocol/http/nsCORSListenerProxy.cpp
+++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp
@@ -630,17 +630,17 @@ NS_IMETHODIMP
 nsCORSListenerProxy::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
   MOZ_ASSERT(mInited, "nsCORSListenerProxy has not been initialized properly");
   nsCOMPtr<nsIStreamListener> listener;
   {
     MutexAutoLock lock(mMutex);
     listener = mOuterListener.forget();
   }
 
-#if defined(FENNEC_NIGHTLY) || defined(FENNEC_BETA)
+#if defined(MOZ_FENNEC)
   // To workaround bug 1546191 (which is likely harmless) we want to add a
   // non-null check.  As it's just an Android/Fennec crash, we also don't want
   // to mask other platforms from possible regressions of this code.
   nsresult rv =
       listener ? listener->OnStopRequest(aRequest, aStatusCode) : NS_OK;
 #else
   nsresult rv = listener->OnStopRequest(aRequest, aStatusCode);
 #endif