From f6df1b589a904630ce46fea7609ede2e5ae6451f Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Thu, 21 Mar 2013 08:20:44 -0700 Subject: [PATCH] Bug 658909 - Remove GWNOJO from JSValToXPCException. r=mrbkap --- js/xpconnect/src/XPCConvert.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp index 48c27f33a30..2f5d50d772e 100644 --- a/js/xpconnect/src/XPCConvert.cpp +++ b/js/xpconnect/src/XPCConvert.cpp @@ -1177,9 +1177,12 @@ XPCConvert::JSValToXPCException(XPCCallContext& ccx, } // is this really a native xpcom object with a wrapper? - XPCWrappedNative* wrapper; - if (nullptr != (wrapper = - XPCWrappedNative::GetWrappedNativeOfJSObject(cx,obj))) { + JSObject *unwrapped = js::UnwrapObjectChecked(obj, /* stopAtOuter = */ false); + if (!unwrapped) + return NS_ERROR_XPC_SECURITY_MANAGER_VETO; + XPCWrappedNative* wrapper = IS_WN_WRAPPER(unwrapped) ? XPCWrappedNative::Get(unwrapped) + : nullptr; + if (wrapper) { nsISupports* supports = wrapper->GetIdentityObject(); nsCOMPtr iface = do_QueryInterface(supports); if (iface) {