From f15bd8f76428eaeb39dded0e5432c48c0074586c Mon Sep 17 00:00:00 2001 From: "rginda%netscape.com" Date: Fri, 8 Mar 2002 02:20:55 +0000 Subject: [PATCH] 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 --- mozilla/caps/src/nsScriptSecurityManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mozilla/caps/src/nsScriptSecurityManager.cpp b/mozilla/caps/src/nsScriptSecurityManager.cpp index 08b7ca79a46..2e753f76a9d 100644 --- a/mozilla/caps/src/nsScriptSecurityManager.cpp +++ b/mozilla/caps/src/nsScriptSecurityManager.cpp @@ -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; }