Bug 644325 - Wrap message receiver to avoid compartment errors. r=jst
authorJosh Matthews <josh@joshmatthews.net>
Wed, 23 Mar 2011 17:50:03 -0400
changeset 69391 7e3efb1073a9821b28d838641091bc899d3cda61
parent 69390 0b44e1e3c995ff2fc9643ff42ab1c3310043954c
child 69392 7af9641c195dc88c8b96b0423425f41deca695be
push id19954
push useropettay@mozilla.com
push dateThu, 12 May 2011 12:23:18 +0000
treeherdermozilla-central@7e3efb1073a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs644325
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 644325 - Wrap message receiver to avoid compartment errors. r=jst
content/base/src/nsFrameMessageManager.cpp
--- a/content/base/src/nsFrameMessageManager.cpp
+++ b/content/base/src/nsFrameMessageManager.cpp
@@ -438,17 +438,18 @@ nsFrameMessageManager::ReceiveMessage(ns
         argv.set(OBJECT_TO_JSVAL(param));
 
         {
           JSAutoEnterCompartment tac;
 
           JSObject* thisObject = JSVAL_TO_OBJECT(thisValue);
 
           if (!tac.enter(ctx, thisObject) ||
-              !JS_WrapValue(ctx, argv.jsval_addr()))
+              !JS_WrapValue(ctx, argv.jsval_addr()) ||
+              !JS_WrapValue(ctx, &funval))
             return NS_ERROR_UNEXPECTED;
 
           JS_CallFunctionValue(ctx, thisObject,
                                funval, 1, argv.jsval_addr(), &rval);
           if (aJSONRetVal) {
             nsString json;
             if (JS_TryJSON(ctx, &rval) &&
                 JS_Stringify(ctx, &rval, nsnull, JSVAL_NULL,