Bug 1333285 - Add null check to nsHttpPipeline::OnHeadersAvailable() r=mcmanus a=lizzard
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 30 Jan 2017 13:15:34 +0100
changeset 378074 49268ecb72fbc8daf6d28e9be88fa5c4a55c2223
parent 378073 f80dc144cdd03a4999b4c527d13538316eb19fdc
child 378075 6666c83998afcafe9b3657c29588daaaf64f1980
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, lizzard
bugs1333285
milestone53.0a2
Bug 1333285 - Add null check to nsHttpPipeline::OnHeadersAvailable() r=mcmanus a=lizzard MozReview-Commit-ID: 9vvpEIUtDkv
netwerk/protocol/http/nsHttpPipeline.cpp
--- a/netwerk/protocol/http/nsHttpPipeline.cpp
+++ b/netwerk/protocol/http/nsHttpPipeline.cpp
@@ -180,28 +180,33 @@ nsHttpPipeline::OnHeadersAvailable(nsAHt
 
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
     MOZ_ASSERT(mConnection, "no connection");
 
     RefPtr<nsHttpConnectionInfo> ci;
     GetConnectionInfo(getter_AddRefs(ci));
     MOZ_ASSERT(ci);
 
+    if (!ci) {
+        return NS_ERROR_UNEXPECTED;
+    }
+
     bool pipeliningBefore = gHttpHandler->ConnMgr()->SupportsPipelining(ci);
 
     // trans has now received its response headers; forward to the real connection
     nsresult rv = mConnection->OnHeadersAvailable(trans,
                                                   requestHead,
                                                   responseHead,
                                                   reset);
 
-    if (!pipeliningBefore && gHttpHandler->ConnMgr()->SupportsPipelining(ci))
+    if (!pipeliningBefore && gHttpHandler->ConnMgr()->SupportsPipelining(ci)) {
         // The received headers have expanded the eligible
         // pipeline depth for this connection
         gHttpHandler->ConnMgr()->ProcessPendingQForEntry(ci);
+    }
 
     return rv;
 }
 
 void
 nsHttpPipeline::CloseTransaction(nsAHttpTransaction *aTrans, nsresult reason)
 {
     LOG(("nsHttpPipeline::CloseTransaction [this=%p trans=%p reason=%x]\n",