Bug 129503, "IsCapabilityEnabled should return PR_TRUE if no script on stack"
sr=brendan, r=mstoltz, a=asa If the js stack has no principals on it, return PR_TRUE from IsCapabilityEnabled . Currently, the only time we'd have a stack devoid of principals is when all f unctions are native. If this assumption changes, this may need to be revisited (depending on what it would mean to be a compiled script without a principal.) git-svn-id: svn://10.0.0.236/trunk@116124 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1668,6 +1668,12 @@ nsScriptSecurityManager::IsCapabilityEnabled(const char *capability,
|
||||
if (*result)
|
||||
return NS_OK;
|
||||
} while ((fp = JS_FrameIterator(cx, &fp)) != nsnull);
|
||||
|
||||
if (!previousPrincipal)
|
||||
{
|
||||
// No principals on the stack, all native code. Allow execution.
|
||||
*result = PR_TRUE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user