mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-27 18:01:44 -10:00
Fixing bugscape 3109, LiveConnect exploit. sr=jband, brendan.
Fixing 58021, exploit in "open in new window," bug 55237. sr=brendan
This commit is contained in:
1 parent
10cf357362
commit
cb2bc2fdbd
3 files changed
+47
-5
No files matched your search
@@ -1102,6 +1102,29 @@ nsScriptSecurityManager::GetPrincipalAndFrame(JSContext *cx,
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
//-- If there's no principal on the stack, look at the global object
|
||||
// and return the innermost frame for annotations.
|
||||
if (cx)
|
||||
{
|
||||
nsCOMPtr<nsIScriptContext> scriptContext =
|
||||
NS_REINTERPRET_CAST(nsIScriptContext*,JS_GetContextPrivate(cx));
|
||||
if (scriptContext)
|
||||
{
|
||||
nsCOMPtr<nsIScriptGlobalObject> global = scriptContext->GetGlobalObject();
|
||||
NS_ENSURE_TRUE(global, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIScriptObjectPrincipal> globalData = do_QueryInterface(global);
|
||||
NS_ENSURE_TRUE(globalData, NS_ERROR_FAILURE);
|
||||
globalData->GetPrincipal(result);
|
||||
if (*result)
|
||||
{
|
||||
JSStackFrame *inner = nsnull;
|
||||
*frameResult = JS_FrameIterator(cx, &inner);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*result = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user