Bug 1451094 - Fix null loadinfo deref. r=mayhemer a=jcristau
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Tue, 10 Apr 2018 17:26:36 +0200
changeset 463205 ce914d685d4950e0aa70d76534481edd6200ecdc
parent 463204 4f4f03584f6a7ce3bc5278b97cd0a090116db501
child 463206 432a01ff2f83fb4e23f815c250a8eb07632ab3fc
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer, jcristau
bugs1451094
milestone60.0
Bug 1451094 - Fix null loadinfo deref. r=mayhemer a=jcristau
netwerk/protocol/http/HttpBaseChannel.cpp
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -2213,17 +2213,19 @@ HttpBaseChannel::RedirectTo(nsIURI *targ
   // and the dance with OnStartRequest et al has to start over.
   // This would break the nsIStreamListener contract.
   NS_ENSURE_FALSE(mOnStartRequestCalled, NS_ERROR_NOT_AVAILABLE);
 
   mAPIRedirectToURI = targetURI;
   // Only Web Extensions are allowed to redirect a channel to a data:
   // URI. To avoid any bypasses after the channel was flagged by
   // the WebRequst API, we are dropping the flag here.
-  mLoadInfo->SetAllowInsecureRedirectToDataURI(false);
+  if (mLoadInfo) {
+    mLoadInfo->SetAllowInsecureRedirectToDataURI(false);
+  }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpBaseChannel::UpgradeToSecure()
 {
   // Upgrades are handled internally between http-on-modify-request and
   // http-on-before-connect, which means upgrades are only possible during