mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 14:54:25 +00:00
Issue #2252 - Prevent crash when attempting to load a script with execution disallowed. This issue is due to the ExecutionContext added in Issue #1691 not handling GetScript() in a context where script execution is not allowed. This expressed itself in crashes when playing MP4s with the NoScript extension installed and enabled.
This commit is contained in:
@@ -2363,11 +2363,14 @@ ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest)
|
||||
JS::Rooted<JSScript*> script(cx);
|
||||
script = exec.GetScript();
|
||||
|
||||
// Create a ClassicScript object and associate it with the
|
||||
// JSScript.
|
||||
RefPtr<ClassicScript> classicScript = new ClassicScript(
|
||||
aRequest->mFetchOptions, aRequest->mBaseURL);
|
||||
classicScript->AssociateWithScript(script);
|
||||
// With scripts disabled GetScript() will return nullptr
|
||||
if (script) {
|
||||
// Create a ClassicScript object and associate it with the
|
||||
// JSScript.
|
||||
RefPtr<ClassicScript> classicScript = new ClassicScript(
|
||||
aRequest->mFetchOptions, aRequest->mBaseURL);
|
||||
classicScript->AssociateWithScript(script);
|
||||
}
|
||||
|
||||
rv = exec.ExecScript();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user