Fix for random crashes caused by uninitialized XPCVariant type. Also, fixed an FMR. b=203434, r=dbardley@netscape.com, sr=jst@netscape.com, a=sspitzer@netscape.com

This commit is contained in:
harishd%netscape.com 2003-05-11 16:27:34 +00:00
parent c7581e8286
commit 42426ec8f0
3 changed files with 10 additions and 13 deletions

View File

@ -261,10 +261,6 @@ WSPCallContext::CallCompletionListener()
rv = XPTC_InvokeByIndex(mAsyncListener, 3, 2, dispatchParams);
}
else if (response) {
// pre-fill the call context into param 0.
dispatchParams[0].val.p = NS_STATIC_CAST(nsIWebServiceCallContext*, this);
dispatchParams[0].SetValIsInterface();
nsCOMPtr<nsIWSDLBinding> binding;
rv = mOperation->GetBinding(getter_AddRefs(binding));
if (NS_FAILED(rv)) {
@ -407,6 +403,8 @@ WSPCallContext::CallCompletionListener()
dispatchParams[paramIndex].val.p =
NS_STATIC_CAST(nsIWebServiceCallContext*, this);
dispatchParams[paramIndex].SetValIsInterface();
dispatchParams[paramIndex].type.flags =
XPT_TDP_POINTER | TD_INTERFACE_TYPE;
rv = XPTC_InvokeByIndex(mAsyncListener, mListenerMethodIndex,
paramCount, dispatchParams);

View File

@ -816,6 +816,11 @@ WSPProxy::VariantToInParameter(nsIInterfaceInfo* aInterfaceInfo,
if (NS_FAILED(rv)) {
return rv;
}
// Set the param's type on the XPTCVariant because xptcinvoke's
// invoke_copy_to_stack depends on it. This fixes bug 203434.
aXPTCVariant->type = type;
uint8 type_tag = type.TagPart();
nsCOMPtr<nsIInterfaceInfo> iinfo;
if (type.IsArray()) {

View File

@ -716,12 +716,12 @@ NS_IMETHODIMP
break;
nsSOAPUtils::GetNextSiblingElement(element, getter_AddRefs(next));
}
if (!NS_FAILED(rv)) {
if (NS_SUCCEEDED(rv)) {
if (count) {
parameters =
(nsISOAPParameter * *)nsMemory::Realloc(parameters,
count *
sizeof(*parameters));
count *
sizeof(*parameters));
}
}
else {
@ -734,12 +734,6 @@ NS_IMETHODIMP
}
*aCount = count;
*aParameters = parameters;
if (count) {
parameters =
(nsISOAPParameter * *)nsMemory::Realloc(parameters,
count *
sizeof(*parameters));
}
return rv;
}