Skip to content

Commit 0afc818

Browse files
committed
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fix #76348: WSDL_CACHE_MEMORY causes Segmentation fault
2 parents 4daa413 + 625f614 commit 0afc818

File tree

4 files changed

+104
-1
lines changed

4 files changed

+104
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ PHP NEWS
1313
- SOAP:
1414
. Fixed bug #50675 (SoapClient can't handle object references correctly).
1515
(Cameron Porter)
16+
. Fixed bug #76348 (WSDL_CACHE_MEMORY causes Segmentation fault). (cmb)
1617

1718
08 Nov 2018, PHP 7.2.12
1819

ext/soap/php_sdl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2449,7 +2449,7 @@ static HashTable* make_persistent_sdl_function_headers(HashTable *headers, HashT
24492449
pheader->ns = strdup(pheader->ns);
24502450
}
24512451

2452-
if (pheader->encode->details.sdl_type) {
2452+
if (pheader->encode && pheader->encode->details.sdl_type) {
24532453
if ((penc = zend_hash_str_find_ptr(ptr_map, (char*)&pheader->encode, sizeof(encodePtr))) == NULL) {
24542454
assert(0);
24552455
}

ext/soap/tests/bugs/bug76348.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
Bug #76348 (WSDL_CACHE_MEMORY causes Segmentation fault)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('soap')) die('skip soap extension not available');
6+
?>
7+
--FILE--
8+
<?php
9+
$client = new SoapClient(__DIR__ . DIRECTORY_SEPARATOR . 'bug76348.wsdl', [
10+
'cache_wsdl' => WSDL_CACHE_MEMORY,
11+
]);
12+
?>
13+
===DONE===
14+
--EXPECT--
15+
===DONE===

ext/soap/tests/bugs/bug76348.wsdl

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<definitions
3+
xmlns="http://schemas.xmlsoap.org/wsdl/"
4+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
5+
xmlns:tns="http://example.x-road.ee/producer/"
6+
xmlns:xrd="http://x-road.eu/xsd/xroad.xsd"
7+
targetNamespace="http://example.x-road.ee/producer/">
8+
<types>
9+
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.x-road.ee/producer/">
10+
<import namespace="http://x-road.ee/xsd/x-road.xsd" schemaLocation="http://x-road.ee/xsd/x-road.xsd"/>
11+
<import namespace="http://www.w3.org/XML/1998/namespace"
12+
schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
13+
<element name="exampleOperation">
14+
<complexType>
15+
<sequence>
16+
<element name="request" type="tns:exampleOperationRequest"/>
17+
</sequence>
18+
</complexType>
19+
</element>
20+
<element name="exampleOperationResponse">
21+
<complexType>
22+
<sequence>
23+
<element name="request" type="tns:exampleOperationRequest"/>
24+
<element name="response" type="tns:exampleOperationResponse"/>
25+
</sequence>
26+
</complexType>
27+
</element>
28+
<complexType name="exampleOperationRequest">
29+
<sequence>
30+
<element name="name">
31+
<complexType>
32+
<sequence>
33+
<element name="id" type="integer" minOccurs="0" nillable="true" />
34+
</sequence>
35+
</complexType>
36+
</element>
37+
</sequence>
38+
</complexType>
39+
<complexType name="exampleOperationResponse">
40+
<sequence>
41+
<element name="ok" type="boolean" />
42+
</sequence>
43+
</complexType>
44+
</schema>
45+
</types>
46+
47+
48+
<message name="exampleOperationInputMessage">
49+
<part name="body" element="tns:exampleOperation"/>
50+
</message>
51+
<message name="exampleOperationOutputMessage">
52+
<part name="body" element="tns:exampleOperationResponse"/>
53+
</message>
54+
55+
<message name="requestheader">
56+
<part name="id" element="xrd:id"/>
57+
</message>
58+
59+
<portType name="example_porttype">
60+
<operation name="exampleOperation">
61+
<input message="tns:exampleOperationInputMessage"/>
62+
<output message="tns:exampleOperationOutputMessage"/>
63+
</operation>
64+
</portType>
65+
66+
<binding name="example_binding" type="tns:example_porttype">
67+
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
68+
<operation name="exampleOperation">
69+
<soap:operation soapAction=""/>
70+
<xrd:version>v1</xrd:version>
71+
<input>
72+
<soap:body use="literal"/>
73+
</input>
74+
<output>
75+
<soap:header message="tns:requestheader" part="id" use="literal"/>
76+
<soap:body use="literal"/>
77+
</output>
78+
</operation>
79+
</binding>
80+
81+
<service name="example">
82+
<port name="example_porttype" binding="tns:example_binding">
83+
<soap:address location="http://PROXY/cgi-bin/consumer_proxy"/>
84+
</port>
85+
</service>
86+
87+
</definitions>

0 commit comments

Comments
 (0)