Bug 1123732 - Null-check uri before trying to use it. r=mcmanus, a=sledru
authorHonza Bambas <honzab.moz@firemni.cz>
Tue, 20 Jan 2015 08:30:00 -0500
changeset 242996 3096b7b44265
parent 242995 e7d732bf6091
child 242997 9b565733c680
push id4357
push userryanvm@gmail.com
push date2015-01-22 19:21 +0000
treeherdermozilla-beta@3096b7b44265 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, sledru
bugs1123732
milestone36.0
Bug 1123732 - Null-check uri before trying to use it. r=mcmanus, a=sledru
netwerk/protocol/http/HttpBaseChannel.cpp
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -2183,18 +2183,20 @@ HttpBaseChannel::SetupReplacementChannel
     }
     // Transfer existing redirect information. Add all of our existing
     // redirects to the new channel.
     for (int32_t i = 0; i < mRedirects.Count(); ++i) {
 #ifdef PR_LOGGING
       nsCOMPtr<nsIURI> uri;
       mRedirects[i]->GetURI(getter_AddRefs(uri));
       nsCString spec;
-      uri->GetSpec(spec);
-      LOG(("HttpBaseChannel::SetupReplacementChannel adding redirect %s "
+      if (uri) {
+        uri->GetSpec(spec);
+      }
+      LOG(("HttpBaseChannel::SetupReplacementChannel adding redirect \'%s\' "
            "[this=%p]", spec.get(), this));
 #endif
       httpInternal->AddRedirect(mRedirects[i]);
     }
 
     // Add our own principal to the redirect information on the new channel. If
     // the redirect is vetoed, then newChannel->AsyncOpen won't be called.
     // However, the new channel's redirect chain will still be complete.