[tbb-commits] [tor-browser] 287/311: Bug 1761026 - Add a null check for FetchDriver::mResponse, r=necko-reviewers, dragana a=dmeehan

gitolite role git at cupani.torproject.org
Tue Apr 26 15:31:27 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit 8c70ec41b3b3a1205feea391fe7ce0de37d325c3
Author: Kershaw Chang <kershaw at mozilla.com>
AuthorDate: Wed Mar 30 13:13:01 2022 +0000

    Bug 1761026 - Add a null check for FetchDriver::mResponse, r=necko-reviewers,dragana a=dmeehan
    
    This patch adds a null check to avoid crashing when `mResponse` is null.
    
    Differential Revision: https://phabricator.services.mozilla.com/D141911
---
 dom/fetch/FetchDriver.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp
index 839cad3ce4a1c..0069f636b0f23 100644
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -1300,10 +1300,14 @@ FetchDriver::OnDataAvailable(nsIRequest* aRequest, nsIInputStream* aInputStream,
     }
   }
 
+  if (!mResponse) {
+    MOZ_ASSERT(false);
+    return NS_ERROR_UNEXPECTED;
+  }
+
   // Needs to be initialized to 0 because in some cases nsStringInputStream may
   // not write to aRead.
   uint32_t aRead = 0;
-  MOZ_ASSERT(mResponse);
   MOZ_ASSERT(mPipeOutputStream);
 
   // From "Main Fetch" step 19: SRI-part2.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list