From 2c0a30185f7f118268dab0907e82dde416f9b698 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Tue, 20 Nov 2018 09:17:31 +0100 Subject: Add a nullcheck on pipelined HTTP connections' pushback. --- netwerk/protocol/http/nsHttpPipeline.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'netwerk') diff --git a/netwerk/protocol/http/nsHttpPipeline.cpp b/netwerk/protocol/http/nsHttpPipeline.cpp index 293de8e39c..4f5777244f 100644 --- a/netwerk/protocol/http/nsHttpPipeline.cpp +++ b/netwerk/protocol/http/nsHttpPipeline.cpp @@ -291,6 +291,11 @@ nsHttpPipeline::PushBack(const char *data, uint32_t length) MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread); MOZ_ASSERT(mPushBackLen == 0, "push back buffer already has data!"); + // Some bad behaving proxies may yank the connection out from under us. + // Check if we still have a connection to work with. + if (!mConnection) + return NS_ERROR_FAILURE; + // If we have no chance for a pipeline (e.g. due to an Upgrade) // then push this data down to original connection if (!mConnection->IsPersistent()) -- cgit v1.2.3