tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit f27ba12b44bfd71319a17d00276a13e5eaac4572
parent c71045fd2cb72805fab347305d27c616a86236c4
Author: Kershaw Chang <kershaw@mozilla.com>
Date:   Mon,  8 Dec 2025 12:47:11 +0000

Bug 1998185 - Check if mAsyncStream is null in nsInputStreamPump::PeekStream, r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D275427

Diffstat:
Mnetwerk/base/nsInputStreamPump.cpp | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/netwerk/base/nsInputStreamPump.cpp b/netwerk/base/nsInputStreamPump.cpp @@ -73,7 +73,10 @@ static nsresult CallPeekFunc(nsIInputStream* aInStream, void* aClosure, nsresult nsInputStreamPump::PeekStream(PeekSegmentFun callback, void* closure) { RecursiveMutexAutoLock lock(mMutex); - MOZ_ASSERT(mAsyncStream, "PeekStream called without stream"); + if (!mAsyncStream) { + MOZ_DIAGNOSTIC_ASSERT(false, "PeekStream called without stream"); + return NS_ERROR_NOT_AVAILABLE; + } nsresult rv = CreateBufferedStreamIfNeeded(); NS_ENSURE_SUCCESS(rv, rv);