Bug 1987806 - Null check compartmentPrivate in FindSameOriginCompartment. a=RyanVM
We're hitting some null crashes in CompartmentOriginInfo::IsSameOrigin, so maybe this is due to a null compartment private? We're iterating over all compartments in a zone during SetNewDocument so maybe there's something weird to stumble over. Original Revision: https://phabricator.services.mozilla.com/D264335 Differential Revision: https://phabricator.services.mozilla.com/D266166
This commit is contained in:
committed by
rvandermeulen@mozilla.com
parent
5467b82c15
commit
a8ffb60fd2
@@ -1948,7 +1948,8 @@ static JS::CompartmentIterResult FindSameOriginCompartment(
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto* compartmentPrivate = xpc::CompartmentPrivate::Get(aCompartment);
|
auto* compartmentPrivate = xpc::CompartmentPrivate::Get(aCompartment);
|
||||||
if (!compartmentPrivate->CanShareCompartmentWith(data->principal)) {
|
if (!compartmentPrivate ||
|
||||||
|
!compartmentPrivate->CanShareCompartmentWith(data->principal)) {
|
||||||
// Can't reuse this one, keep going.
|
// Can't reuse this one, keep going.
|
||||||
return JS::CompartmentIterResult::KeepGoing;
|
return JS::CompartmentIterResult::KeepGoing;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user