From 42bb8ed2b55d45f404050e019eb12a1952e4eb93 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 18 Feb 2009 13:25:48 +0000 Subject: [PATCH] Fixed bug #47049 (SoapClient::__soapCall causes a segmentation fault) --- ext/soap/soap.c | 12 ++++- ext/soap/tests/bugs/bug47049.phpt | 19 ++++++++ ext/soap/tests/bugs/bug47049.wsdl | 80 +++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 ext/soap/tests/bugs/bug47049.phpt create mode 100644 ext/soap/tests/bugs/bug47049.wsdl diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 37f479f71d..fdd983993f 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -4377,7 +4377,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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.40.0