Merge branch 'PHP-7.3'

This commit is contained in:
Nikita Popov 2019-01-04 12:41:30 +01:00
commit 1be8b3cbd8
3 changed files with 88 additions and 2 deletions

View File

@ -1827,9 +1827,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);

View File

@ -0,0 +1,25 @@
--TEST--
Bug #77410: Segmentation Fault when executing method with an empty parameter
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$client = new class(__DIR__ . '/bug77410.wsdl', [
'cache_wsdl' => 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--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:test"><SOAP-ENV:Body><ns1:MyMethodRequest><parameter/></ns1:MyMethodRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" ?>
<definitions targetNamespace="urn:test"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:test="urn:test"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<portType name="TestPortType">
<operation name="MyMethod">
<input message="test:MyMethodRequestMessage" />
<output message="test:MyMethodResponseMessage" />
</operation>
</portType>
<binding name="TestBinding" type="test:TestPortType">
<operation name="MyMethod">
<input><soap:body use="literal" /></input>
<output><soap:body use="literal" /></output>
</operation>
</binding>
<message name="MyMethodRequestMessage">
<part name="parameters" element="test:MyMethodRequest" />
</message>
<message name="MyMethodResponseMessage">
<part name="parameters" element="test:MyMethodResponse" />
</message>
<types>
<schema targetNamespace="urn:test" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="MyMethodRequest">
<complexType>
<sequence>
<element name="parameter" type="test:MyMethodRequestObject" />
</sequence>
</complexType>
</element>
<element name="MyMethodResponse" />
<complexType name="MyMethodRequestObject">
<complexContent>
<extension base="test:DynamicData" />
</complexContent>
</complexType>
<complexType name="DynamicData" />
</schema>
</types>
<service name="TestService">
<port binding="test:TestBinding" name="TestPort">
<soap:address location="http://localhost:8080/test-service" />
</port>
</service>
</definitions>