зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1393287 - Rejigger ctypes library close() code so that it's safe against PR_UnloadLibrary incidentally invoking an indirect function call (which happens if sandboxing code overrides some of the signal code underlying the library-unload entrypoint). r=sfink
--HG-- extra : rebase_source : f8049d8646c9764dc68bf2dc33a0ecd893fb5692
This commit is contained in:
Родитель
33c9a0faed
Коммит
1cd5e89895
|
@ -238,10 +238,11 @@ bool
|
|||
Library::Close(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
JSObject* obj = JS_THIS_OBJECT(cx, vp);
|
||||
if (!obj)
|
||||
return false;
|
||||
if (!IsLibrary(obj)) {
|
||||
|
||||
RootedObject obj(cx);
|
||||
if (args.thisv().isObject())
|
||||
obj = &args.thisv().toObject();
|
||||
if (!obj || !IsLibrary(obj)) {
|
||||
JS_ReportErrorASCII(cx, "not a library");
|
||||
return false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче