mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Fixing crashes during tests by null-checking the principal URI as appropriate. Bug 495176
This commit is contained in:
parent
71e7b160c0
commit
123cf2cf60
@ -842,6 +842,9 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(PRUint32 aAction,
|
||||
if (!nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin) {
|
||||
nsCOMPtr<nsIURI> uri, domain;
|
||||
subjectPrincipal->GetURI(getter_AddRefs(uri));
|
||||
// Subject can't be system if we failed the security
|
||||
// check, so |uri| is non-null.
|
||||
NS_ASSERTION(uri, "How did that happen?");
|
||||
GetOriginFromURI(uri, subjectOrigin);
|
||||
subjectPrincipal->GetDomain(getter_AddRefs(domain));
|
||||
if (domain) {
|
||||
@ -859,7 +862,9 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(PRUint32 aAction,
|
||||
objectPrincipal) {
|
||||
nsCOMPtr<nsIURI> uri, domain;
|
||||
objectPrincipal->GetURI(getter_AddRefs(uri));
|
||||
GetOriginFromURI(uri, objectOrigin);
|
||||
if (uri) { // Object principal might be system
|
||||
GetOriginFromURI(uri, objectOrigin);
|
||||
}
|
||||
objectPrincipal->GetDomain(getter_AddRefs(domain));
|
||||
if (domain) {
|
||||
GetOriginFromURI(domain, objectDomain);
|
||||
|
Loading…
Reference in New Issue
Block a user