Bug 1700091 - Always hold mutex when accessing TypeHostRecord::mResults r=necko-reviewers,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D109343
This commit is contained in:
Valentin Gosu 2021-03-24 14:17:48 +00:00
parent fa0ba706bb
commit b9b3ca2495

View File

@ -629,6 +629,7 @@ TypeHostRecord::GetAllRecordsWithEchConfig(
NS_IMETHODIMP
TypeHostRecord::GetHasIPAddresses(bool* aResult) {
NS_ENSURE_ARG(aResult);
MutexAutoLock lock(mResultsLock);
if (!mResults.is<TypeRecordHTTPSSVC>()) {
return NS_ERROR_NOT_AVAILABLE;
@ -642,6 +643,7 @@ TypeHostRecord::GetHasIPAddresses(bool* aResult) {
NS_IMETHODIMP
TypeHostRecord::GetAllRecordsExcluded(bool* aResult) {
NS_ENSURE_ARG(aResult);
MutexAutoLock lock(mResultsLock);
if (!mResults.is<TypeRecordHTTPSSVC>()) {
return NS_ERROR_NOT_AVAILABLE;