From c0458d11e777334b7cdae9df8f413b092762077d Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Fri, 25 May 2007 20:45:50 +0000 Subject: [PATCH] Bug 351007 Crash @ XPCWrappedNative::CallMethod passing null to out A*String parameters r+sr=jst git-svn-id: svn://10.0.0.236/trunk@227030 18797224-902f-48f8-a5cc-f745e15eee43 --- .../js/src/xpconnect/src/xpcwrappednative.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp b/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp index 41dd19f9f3d..c7892bcf705 100644 --- a/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp +++ b/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp @@ -1959,21 +1959,22 @@ XPCWrappedNative::CallMethod(XPCCallContext& ccx, // set 'src' to be the object from which we get the value and // prepare for out param + if((paramInfo.IsOut() || paramInfo.IsDipper()) && + !paramInfo.IsRetval() && + (JSVAL_IS_PRIMITIVE(argv[i]) || + !OBJ_GET_PROPERTY(ccx, JSVAL_TO_OBJECT(argv[i]), + rt->GetStringID(XPCJSRuntime::IDX_VALUE), + &src))) + { + ThrowBadParam(NS_ERROR_XPC_NEED_OUT_OBJECT, i, ccx); + goto done; + } + if(paramInfo.IsOut()) { dp->SetPtrIsData(); dp->ptr = &dp->val; - if(!paramInfo.IsRetval() && - (JSVAL_IS_PRIMITIVE(argv[i]) || - !OBJ_GET_PROPERTY(ccx, JSVAL_TO_OBJECT(argv[i]), - rt->GetStringID(XPCJSRuntime::IDX_VALUE), - &src))) - { - ThrowBadParam(NS_ERROR_XPC_NEED_OUT_OBJECT, i, ccx); - goto done; - } - if(type.IsPointer() && type_tag != nsXPTType::T_INTERFACE && !paramInfo.IsShared())