From f2a8b6b9ff85d8c8a3d7c5bf15431a72feae6cef Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Sun, 20 Jan 2008 11:21:36 +0000 Subject: [PATCH] Bug 334195 XPCWrappedNative::HandlePossibleNameCaseError dereferences an unitialized value if !set r=dbradley sr=jst a=mtschrep git-svn-id: svn://10.0.0.236/trunk@243603 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/src/xpconnect/src/xpcwrappednative.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp b/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp index 16e4bcc068c..1c195d36496 100644 --- a/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp +++ b/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp @@ -867,8 +867,8 @@ XPCWrappedNative::Init(XPCCallContext& ccx, JSObject* parent, JSBool isGlobal, jsclazz->finalize, "bad class"); JSObject* protoJSObject = HasProto() ? - GetProto()->GetJSProtoObject() : - GetScope()->GetPrototypeJSObject(); + GetProto()->GetJSProtoObject() : + GetScope()->GetPrototypeJSObject(); mFlatJSObject = xpc_NewSystemInheritingJSObject(ccx, jsclazz, protoJSObject, parent); @@ -2840,7 +2840,9 @@ XPCWrappedNative::HandlePossibleNameCaseError(XPCCallContext& ccx, (JSBool)NS_PTR_TO_INT32(iface->FindMember(STRING_TO_JSVAL(newJSStr))))) { // found it! - const char* ifaceName = localIface->GetNameString(); + const char* ifaceName = set ? + localIface->GetNameString() : + iface->GetNameString(); const char* goodName = JS_GetStringBytes(newJSStr); const char* badName = JS_GetStringBytes(oldJSStr); char* locationStr = nsnull;