mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 493495 followup. Just cut off the recursion if it gets too deep. r+sr=mrbkap
This commit is contained in:
parent
b51c4c3b13
commit
0cccd6dadc
@ -143,6 +143,14 @@ nsresult
|
||||
GetPrincipalDomainOrigin(nsIPrincipal* aPrincipal,
|
||||
nsACString& aOrigin)
|
||||
{
|
||||
if (nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin > 1) {
|
||||
// Allow a single recursive call to GetPrincipalDomainOrigin, since that
|
||||
// might be happening on a different principal from the first call. But
|
||||
// after that, cut off the recursion; it just indicates that something
|
||||
// we're doing in this method causes us to reenter a security check here.
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
nsAutoInPrincipalDomainOriginSetter autoSetter;
|
||||
aOrigin.Truncate();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user