[tbb-commits] [tor-browser] 45/76: Bug 1759506 - Avoid crashing if mReservedClientInfo already has something, r=edenchuang a=RyanVM

gitolite role git at cupani.torproject.org
Wed Mar 30 20:40:13 UTC 2022


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

richard pushed a commit to branch tor-browser-91.8.0esr-11.0-1
in repository tor-browser.

commit 6e9e7a2feaeb6aeb752820b6b9323cb21073eb5a
Author: Kershaw Chang <kershaw at mozilla.com>
AuthorDate: Wed Mar 16 20:05:59 2022 +0000

    Bug 1759506 - Avoid crashing if mReservedClientInfo already has something, r=edenchuang a=RyanVM
    
    Differential Revision: https://phabricator.services.mozilla.com/D141262
---
 netwerk/base/LoadInfo.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/netwerk/base/LoadInfo.cpp b/netwerk/base/LoadInfo.cpp
index a7ba12b00f95f..2bca01945ce0e 100644
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -1768,9 +1768,12 @@ void LoadInfo::SetReservedClientInfo(const ClientInfo& aClientInfo) {
   MOZ_DIAGNOSTIC_ASSERT(mInitialClientInfo.isNothing());
   // Treat assignments of the same value as a no-op.  The emplace below
   // will normally assert when overwriting an existing value.
-  if (mReservedClientInfo.isSome() &&
-      mReservedClientInfo.ref() == aClientInfo) {
-    return;
+  if (mReservedClientInfo.isSome()) {
+    if (mReservedClientInfo.ref() == aClientInfo) {
+      return;
+    }
+    MOZ_DIAGNOSTIC_ASSERT(false, "mReservedClientInfo already set");
+    mReservedClientInfo.reset();
   }
   mReservedClientInfo.emplace(aClientInfo);
 }

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


More information about the tbb-commits mailing list