diff options
author | Moonchild <moonchild@palemoon.org> | 2021-01-27 10:52:32 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-01-27 10:52:32 +0000 |
commit | e1daeef18312a0cb17eda6bed7f363d8748ed4a3 (patch) | |
tree | 13bdb782f144c6e884ae788ecd20be40f0cd90f1 | |
parent | f77c7a36b74be10b633a2810bd2bfffd3bebcc0f (diff) | |
download | uxp-e1daeef18312a0cb17eda6bed7f363d8748ed4a3.tar.gz |
[network] Hold mutex when accessing mSecurityInfo.RC_20210128
-rw-r--r-- | netwerk/protocol/http/nsHttpTransaction.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp index e7f3ca0eff..9c5895cb07 100644 --- a/netwerk/protocol/http/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -765,7 +765,10 @@ nsHttpTransaction::ReadSegments(nsAHttpSegmentReader *reader, if (!mConnected && !m0RTTInProgress) { mConnected = true; - mConnection->GetSecurityInfo(getter_AddRefs(mSecurityInfo)); + nsCOMPtr<nsISupports> info; + mConnection->GetSecurityInfo(getter_AddRefs(info)); + MutexAutoLock lock(mLock); + mSecurityInfo = std::move(info); } mDeferredSendProgress = false; @@ -1314,7 +1317,10 @@ nsHttpTransaction::Restart() seekable->Seek(nsISeekableStream::NS_SEEK_SET, 0); // clear old connection state... - mSecurityInfo = nullptr; + { + MutexAutoLock lock(mLock); + mSecurityInfo = nullptr; + } if (mConnection) { if (!mReuseOnRestart) { mConnection->DontReuse(); @@ -2489,7 +2495,10 @@ nsHttpTransaction::Finish0RTT(bool aRestart, bool aAlpnChanged /* ignored */) } else if (!mConnected) { // this is code that was skipped in ::ReadSegments while in 0RTT mConnected = true; - mConnection->GetSecurityInfo(getter_AddRefs(mSecurityInfo)); + nsCOMPtr<nsISupports> info; + mConnection->GetSecurityInfo(getter_AddRefs(info)); + MutexAutoLock lock(mLock); + mSecurityInfo = std::move(info); } return NS_OK; } |