From ff40cba9f37a2fa5bcddd4fa228a67543ef896c3 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Fri, 16 Feb 2024 14:30:53 +0800 Subject: [PATCH] network: check if `mBrotli` is not null before calling its members, fix crash when visiting www.ixbt.com. --- netwerk/streamconv/converters/nsHTTPCompressConv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netwerk/streamconv/converters/nsHTTPCompressConv.cpp b/netwerk/streamconv/converters/nsHTTPCompressConv.cpp index e4a9e1e6da..999cc35366 100644 --- a/netwerk/streamconv/converters/nsHTTPCompressConv.cpp +++ b/netwerk/streamconv/converters/nsHTTPCompressConv.cpp @@ -134,7 +134,7 @@ nsHTTPCompressConv::OnStopRequest(nsIRequest* request, nsISupports *aContext, if (fpChannel && !isPending) { fpChannel->ForcePending(true); } - if (mBrotli->mTotalOut == 0 && !BrotliDecoderIsFinished(&mBrotli->mState)) { + if (mBrotli && mBrotli->mTotalOut == 0 && !BrotliDecoderIsFinished(&mBrotli->mState)) { status = NS_ERROR_INVALID_CONTENT_ENCODING; } if (fpChannel && !isPending) {