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 05b639b7ec6bf049ff38bfa568c85edbcef967b4 Author: Kershaw Chang kershaw@mozilla.com AuthorDate: Wed Mar 16 20:05:59 2022 +0000
Bug 1759506 - Avoid crashing if mReservedClientInfo already has something, r=edenchuang a=pascalc
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 da5881d190a66..f3c52234b1335 100644 --- a/netwerk/base/LoadInfo.cpp +++ b/netwerk/base/LoadInfo.cpp @@ -1840,9 +1840,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); }