Skip to content

Commit 1be8b3c

Browse files
committed
Merge branch 'PHP-7.3'
2 parents 4c4216b + 361d3ed commit 1be8b3c

File tree

3 files changed

+88
-2
lines changed

3 files changed

+88
-2
lines changed

ext/soap/php_encoding.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,9 +1827,9 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
18271827
sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_LIST &&
18281828
sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
18291829

1830-
if (prop) {GC_PROTECT_RECURSION(prop);}
1830+
if (prop) { GC_TRY_PROTECT_RECURSION(prop); }
18311831
xmlParam = master_to_xml(sdlType->encode, data, style, parent);
1832-
if (prop) {GC_UNPROTECT_RECURSION(prop);}
1832+
if (prop) { GC_TRY_UNPROTECT_RECURSION(prop); }
18331833
} else {
18341834
zval rv;
18351835
zval *tmp = get_zval_property(data, "_", &rv);

ext/soap/tests/bug77410.phpt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
Bug #77410: Segmentation Fault when executing method with an empty parameter
3+
--SKIPIF--
4+
<?php require_once('skipif.inc'); ?>
5+
--FILE--
6+
<?php
7+
8+
$client = new class(__DIR__ . '/bug77410.wsdl', [
9+
'cache_wsdl' => WSDL_CACHE_NONE,
10+
'trace' => 1,
11+
]) extends SoapClient {
12+
public function __doRequest($request, $location, $action, $version, $one_way = 0) {
13+
echo $request, "\n";
14+
return '';
15+
}
16+
};
17+
18+
$client->MyMethod([
19+
'parameter' => [],
20+
]);
21+
22+
?>
23+
--EXPECT--
24+
<?xml version="1.0" encoding="UTF-8"?>
25+
<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>

ext/soap/tests/bug77410.wsdl

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<definitions targetNamespace="urn:test"
3+
xmlns="http://schemas.xmlsoap.org/wsdl/"
4+
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
5+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
6+
xmlns:test="urn:test"
7+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
8+
9+
<portType name="TestPortType">
10+
<operation name="MyMethod">
11+
<input message="test:MyMethodRequestMessage" />
12+
<output message="test:MyMethodResponseMessage" />
13+
</operation>
14+
</portType>
15+
16+
<binding name="TestBinding" type="test:TestPortType">
17+
<operation name="MyMethod">
18+
<input><soap:body use="literal" /></input>
19+
<output><soap:body use="literal" /></output>
20+
</operation>
21+
</binding>
22+
23+
<message name="MyMethodRequestMessage">
24+
<part name="parameters" element="test:MyMethodRequest" />
25+
</message>
26+
27+
<message name="MyMethodResponseMessage">
28+
<part name="parameters" element="test:MyMethodResponse" />
29+
</message>
30+
31+
<types>
32+
<schema targetNamespace="urn:test" xmlns="http://www.w3.org/2001/XMLSchema">
33+
34+
<element name="MyMethodRequest">
35+
<complexType>
36+
<sequence>
37+
<element name="parameter" type="test:MyMethodRequestObject" />
38+
</sequence>
39+
</complexType>
40+
</element>
41+
42+
<element name="MyMethodResponse" />
43+
44+
<complexType name="MyMethodRequestObject">
45+
<complexContent>
46+
<extension base="test:DynamicData" />
47+
</complexContent>
48+
</complexType>
49+
50+
<complexType name="DynamicData" />
51+
52+
</schema>
53+
</types>
54+
55+
<service name="TestService">
56+
<port binding="test:TestBinding" name="TestPort">
57+
<soap:address location="http://localhost:8080/test-service" />
58+
</port>
59+
</service>
60+
61+
</definitions>

0 commit comments

Comments
 (0)