From: Dmitry Stogov Date: Wed, 18 Feb 2009 13:25:32 +0000 (+0000) Subject: Fixed bug #47049 (SoapClient::__soapCall causes a segmentation fault) X-Git-Tag: php-5.2.9RC3~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80e195012181a41a86445979a5d09deaf4e10cb9;p=php Fixed bug #47049 (SoapClient::__soapCall causes a segmentation fault) --- diff --git a/NEWS b/NEWS index b109a4ed26..58df92eb7a 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ PHP NEWS (Matt) - Fixed bug #47399 (mb_check_encoding() returns true for some illegal SJIS characters). (for-bugs at hnw dot jp, Moriyoshi) +- Fixed bug #47049 (SoapClient::__soapCall causes a segmentation fault). + (Dmitry) - Fixed bug #45940 (MySQLI OO does not populate connect_error property on failed connect). (Johannes) - Fixed bug #45923 (mb_st[r]ripos() offset not handled correctly). (Moriyoshi) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index a4b4e1bf29..ca2b0668fe 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -4187,7 +4187,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 (zend_hash_find(Z_OBJPROP_P(this_ptr), "use", sizeof("use"), (void **)&zuse) == SUCCESS && 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +