[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor-browser] 287/311: Bug 1761026 - Add a null check for FetchDriver::mResponse, r=necko-reviewers, dragana a=dmeehan
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@xxxxxxxxxxx>
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.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits