зеркало из https://github.com/mozilla/gecko-dev.git
Bug 965921 - Handle addons that expose JS-implemented XPCOM components to content. r=mrbkap
This commit is contained in:
Родитель
f209e98c03
Коммит
98779f9a32
|
@ -155,9 +155,12 @@ XPC_WN_DoubleWrappedGetter(JSContext *cx, unsigned argc, jsval *vp)
|
|||
return true;
|
||||
}
|
||||
|
||||
// It is a double wrapped object. This should never appear in content these
|
||||
// days, but let's be safe here.
|
||||
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
|
||||
// It is a double wrapped object. This should really never appear in
|
||||
// content these days, but addons still do it - see bug 965921.
|
||||
if (MOZ_UNLIKELY(!nsContentUtils::IsCallerChrome())) {
|
||||
JS_ReportError(cx, "Attempt to use .wrappedJSObject in untrusted code");
|
||||
return false;
|
||||
}
|
||||
args.rval().setObject(*realObject);
|
||||
return JS_WrapValue(cx, args.rval());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче