зеркало из 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// It is a double wrapped object. This should never appear in content these
|
// It is a double wrapped object. This should really never appear in
|
||||||
// days, but let's be safe here.
|
// content these days, but addons still do it - see bug 965921.
|
||||||
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
|
if (MOZ_UNLIKELY(!nsContentUtils::IsCallerChrome())) {
|
||||||
|
JS_ReportError(cx, "Attempt to use .wrappedJSObject in untrusted code");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
args.rval().setObject(*realObject);
|
args.rval().setObject(*realObject);
|
||||||
return JS_WrapValue(cx, args.rval());
|
return JS_WrapValue(cx, args.rval());
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче