Bug 590121 - Null nsHttpResponseHead crashes in redirect. r=dwitte@gmail.com, a=blocking2.0final+
authorJason Duell <jduell.mcbugs@gmail.com>
Wed, 08 Sep 2010 17:53:55 -0700
changeset 52246 a84393d459c834405fab86c54e92342e5d28fe49
parent 52245 1b34b75baf264b7a01ee37c26eb02f198ee4d7e1
child 52247 71989679784aeab3db7599c994ee9896bafa5f99
push idunknown
push userunknown
push dateunknown
reviewersdwitte, blocking2
bugs590121
milestone2.0b6pre
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 590121 - Null nsHttpResponseHead crashes in redirect. r=dwitte@gmail.com, a=blocking2.0final+
netwerk/protocol/http/HttpChannelParentListener.cpp
--- a/netwerk/protocol/http/HttpChannelParentListener.cpp
+++ b/netwerk/protocol/http/HttpChannelParentListener.cpp
@@ -215,21 +215,24 @@ HttpChannelParentListener::AsyncOnChanne
 
   // And finally, let the content process decide to redirect or not.
   mRedirectCallback = callback;
 
   nsCOMPtr<nsIURI> newURI;
   newChannel->GetURI(getter_AddRefs(newURI));
 
   nsHttpChannel *oldHttpChannel = static_cast<nsHttpChannel *>(oldChannel);
+  nsHttpResponseHead *responseHead = oldHttpChannel->GetResponseHead();
+
   // TODO: check mActiveChannel->mIPCClosed and return val from Send function
   mActiveChannel->SendRedirect1Begin(mRedirectChannel,
                                      IPC::URI(newURI),
                                      redirectFlags,
-                                     *oldHttpChannel->GetResponseHead());
+                                     responseHead ? *responseHead 
+                                                  : nsHttpResponseHead());
 
   // mActiveChannel gets the response in RecvRedirect2Result and forwards it
   // to this wrapper through OnContentRedirectResultReceived
 
   return NS_OK;
 }
 
 void