From: Dmitry Stogov Date: Wed, 18 Feb 2009 13:25:59 +0000 (+0000) Subject: Fixed bug #47049 (SoapClient::__soapCall causes a segmentation fault) X-Git-Tag: php-5.4.0alpha1~191^2~4243 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51b4f3426e166f88edcc8349c5025363b08f5a22;p=php Fixed bug #47049 (SoapClient::__soapCall causes a segmentation fault) --- diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 7af0978a41..dea0858e05 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -4821,7 +4821,17 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function /*style = SOAP_RPC;*/ if (style == SOAP_RPC) { ns = encode_add_ns(body, uri); - method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL); + if (function_name) { + method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL); + } else if (function && function->requestName) { + method = xmlNewChild(body, ns, BAD_CAST(function->requestName), NULL); + } else if (function && function->functionName) { + method = xmlNewChild(body, ns, BAD_CAST(function->functionName), NULL); + } else { + method = body; + } + } else { + method = body; } if (client->use == SOAP_LITERAL) { diff --git a/ext/soap/tests/bugs/bug47049.phpt b/ext/soap/tests/bugs/bug47049.phpt new file mode 100644 index 0000000000..bdc16274e2 --- /dev/null +++ b/ext/soap/tests/bugs/bug47049.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #47049 (SoapClient::__soapCall causes a segmentation fault) +--SKIPIF-- + +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- + 1 , 'exceptions' => 0)); +$host = array('uuid' => 'foo'); +$software_list = array(array('name' => 'package', 'version' => '1.2.3', 'state' => 'installed')); +$updates = array(); +$report_id = $client->__soapCall('reportSoftwareStatus',array($host, $software_list, $updates)); +echo $client->__getLastRequest(); +?> +--EXPECT-- + +foopackage1.2.3installed diff --git a/ext/soap/tests/bugs/bug47049.wsdl b/ext/soap/tests/bugs/bug47049.wsdl new file mode 100644 index 0000000000..b5730a38eb --- /dev/null +++ b/ext/soap/tests/bugs/bug47049.wsdl @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +