From: Nikita Popov Date: Fri, 4 Jan 2019 11:40:28 +0000 (+0100) Subject: Fix bug #77410 X-Git-Tag: php-7.3.2RC1~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=361d3ede9394d03defba64237628e6b1a0a2a16b;p=php Fix bug #77410 --- diff --git a/NEWS b/NEWS index ddfb0c9b41..eec10f3ef1 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,10 @@ PHP NEWS . Fixed bug #77273 (array_walk_recursive corrupts value types leading to PDO failure). (Nikita) +- SOAP: + . Fixed bug #77410 (Segmentation Fault when executing method with an empty + parameter). (Nikita) + - Sockets: . Fixed bug #76839 (socket_recvfrom may return an invalid 'from' address on MacOS). (Michael Meyer) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index cd7ea06649..87e13161c7 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1856,9 +1856,9 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_LIST && sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) { - if (prop) {GC_PROTECT_RECURSION(prop);} + if (prop) { GC_TRY_PROTECT_RECURSION(prop); } xmlParam = master_to_xml(sdlType->encode, data, style, parent); - if (prop) {GC_UNPROTECT_RECURSION(prop);} + if (prop) { GC_TRY_UNPROTECT_RECURSION(prop); } } else { zval rv; zval *tmp = get_zval_property(data, "_", &rv); diff --git a/ext/soap/tests/bug77410.phpt b/ext/soap/tests/bug77410.phpt new file mode 100644 index 0000000000..2b74102523 --- /dev/null +++ b/ext/soap/tests/bug77410.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #77410: Segmentation Fault when executing method with an empty parameter +--SKIPIF-- + +--FILE-- + WSDL_CACHE_NONE, + 'trace' => 1, +]) extends SoapClient { + public function __doRequest($request, $location, $action, $version, $one_way = 0) { + echo $request, "\n"; + return ''; + } +}; + +$client->MyMethod([ + 'parameter' => [], +]); + +?> +--EXPECT-- + + diff --git a/ext/soap/tests/bug77410.wsdl b/ext/soap/tests/bug77410.wsdl new file mode 100644 index 0000000000..fb976485d6 --- /dev/null +++ b/ext/soap/tests/bug77410.wsdl @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +