mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 959705. Fix unsafe reference hazards in xpconnect code. r=bholley
This commit is contained in:
parent
f4a5d99834
commit
f1a348da85
@ -1013,8 +1013,8 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile,
|
||||
if (script) {
|
||||
ok = JS_ExecuteScriptVersion(cx, obj, script, nullptr, JSVERSION_LATEST);
|
||||
} else {
|
||||
jsval rval;
|
||||
ok = JS_CallFunction(cx, obj, function, 0, nullptr, &rval);
|
||||
RootedValue rval(cx);
|
||||
ok = JS_CallFunction(cx, obj, function, 0, nullptr, rval.address());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3408,8 +3408,8 @@ nsXPCComponents_Utils::GetIncumbentGlobal(const Value &aCallback,
|
||||
|
||||
// Invoke the callback, if passed.
|
||||
if (aCallback.isObject()) {
|
||||
Value ignored;
|
||||
if (!JS_CallFunctionValue(aCx, nullptr, aCallback, 1, globalVal.address(), &ignored))
|
||||
RootedValue ignored(aCx);
|
||||
if (!JS_CallFunctionValue(aCx, nullptr, aCallback, 1, globalVal.address(), ignored.address()))
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -1134,14 +1134,15 @@ ProcessArgs(JSContext *cx, JS::Handle<JSObject*> obj, char **argv, int argc, XPC
|
||||
break;
|
||||
case 'e':
|
||||
{
|
||||
jsval rval;
|
||||
RootedValue rval(cx);
|
||||
|
||||
if (++i == argc) {
|
||||
return usage();
|
||||
}
|
||||
|
||||
JS_EvaluateScriptForPrincipals(cx, obj, gJSPrincipals, argv[i],
|
||||
strlen(argv[i]), "-e", 1, &rval);
|
||||
strlen(argv[i]), "-e", 1,
|
||||
rval.address());
|
||||
|
||||
isInteractive = false;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user