Bug 1589953 - Initialize `read` in AlternativeDataStreamListener::OnDataAvailable(); r=edgar
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 20 Oct 2019 19:29:06 +0000
changeset 498351 71e1f7fa5cf2b9a522d6c7b356420961e9285368
parent 498350 9d0d9c65ec9eee6bff950486a4d3e69de749d6bf
child 498352 55743f55095ccd3851db6abb49ca36e8f1eebceb
push id36717
push usernbeleuzu@mozilla.com
push dateMon, 21 Oct 2019 21:51:55 +0000
treeherdermozilla-central@563f437f24b9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedgar
bugs1589953
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1589953 - Initialize `read` in AlternativeDataStreamListener::OnDataAvailable(); r=edgar Differential Revision: https://phabricator.services.mozilla.com/D49849
dom/fetch/FetchDriver.cpp
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -256,17 +256,17 @@ AlternativeDataStreamListener::OnStartRe
 
 NS_IMETHODIMP
 AlternativeDataStreamListener::OnDataAvailable(nsIRequest* aRequest,
                                                nsIInputStream* aInputStream,
                                                uint64_t aOffset,
                                                uint32_t aCount) {
   if (mStatus == AlternativeDataStreamListener::LOADING) {
     MOZ_ASSERT(mPipeAlternativeOutputStream);
-    uint32_t read;
+    uint32_t read = 0;
     return aInputStream->ReadSegments(
         NS_CopySegmentToStream, mPipeAlternativeOutputStream, aCount, &read);
   }
   if (mStatus == AlternativeDataStreamListener::FALLBACK) {
     MOZ_ASSERT(mFetchDriver);
     return mFetchDriver->OnDataAvailable(aRequest, aInputStream, aOffset,
                                          aCount);
   }