From a143705045a4ff7cfb78fc1c24ae65bee24a063e Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 1 Nov 2021 13:38:40 +0000 Subject: [PATCH] Bug 1737837 - Fix truncated storeOptimizedEncoding stream. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D129880 --- dom/fetch/FetchUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/fetch/FetchUtil.cpp b/dom/fetch/FetchUtil.cpp index 5b2b4fe065f7..8631bb5622cf 100644 --- a/dom/fetch/FetchUtil.cpp +++ b/dom/fetch/FetchUtil.cpp @@ -627,7 +627,7 @@ class JSStreamConsumer final : public nsIInputStreamCallback, } MOZ_RELEASE_ASSERT(ret == Z_STREAM_END); - dstBytes.shrinkTo(zstream.next_out - compressBegin); + dstBytes.shrinkTo(zstream.next_out - dstBytes.begin()); NS_DispatchToMainThread(new StoreOptimizedEncodingRunnable( std::move(mCache), std::move(dstBytes)));