Skip to content

Commit b2f7be7

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed bug #79357
2 parents 191451d + 760faa1 commit b2f7be7

File tree

4 files changed

+70
-2
lines changed

4 files changed

+70
-2
lines changed

Zend/zend_vm_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8124,10 +8124,10 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
81248124
#endif
81258125

81268126
if (ret == NULL) {
8127-
ZVAL_NULL(&retval);
81288127
ret = &retval;
81298128
}
81308129

8130+
ZVAL_NULL(ret);
81318131
if (!zend_execute_internal) {
81328132
/* saves one function call if zend_execute_internal is not used */
81338133
fbc->internal_function.handler(call, ret);

Zend/zend_vm_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2767,10 +2767,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
27672767
#endif
27682768

27692769
if (ret == NULL) {
2770-
ZVAL_NULL(&retval);
27712770
ret = &retval;
27722771
}
27732772

2773+
ZVAL_NULL(ret);
27742774
if (!zend_execute_internal) {
27752775
/* saves one function call if zend_execute_internal is not used */
27762776
fbc->internal_function.handler(call, ret);

ext/soap/tests/bug79357.phpt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Bug #79357: SOAP request segfaults when any request parameter is missing
3+
--FILE--
4+
<?php
5+
6+
$sc = new SoapClient(__DIR__ . '/bug79357.wsdl');
7+
$res = $sc->Add(['intA'=>1]);
8+
var_dump($res);
9+
10+
?>
11+
--EXPECTF--
12+
Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no 'intB' property in %s:%d
13+
Stack trace:
14+
#0 %s(%d): SoapClient->__call('Add', Array)
15+
#1 {main}
16+
thrown in %s on line %d

ext/soap/tests/bug79357.wsdl

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
3+
<wsdl:types>
4+
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
5+
<s:element name="Add">
6+
<s:complexType>
7+
<s:sequence>
8+
<s:element minOccurs="1" maxOccurs="1" name="intA" type="s:int" />
9+
<s:element minOccurs="1" maxOccurs="1" name="intB" type="s:int" />
10+
</s:sequence>
11+
</s:complexType>
12+
</s:element>
13+
<s:element name="AddResponse">
14+
<s:complexType>
15+
<s:sequence>
16+
<s:element minOccurs="1" maxOccurs="1" name="AddResult" type="s:int" />
17+
</s:sequence>
18+
</s:complexType>
19+
</s:element>
20+
</s:schema>
21+
</wsdl:types>
22+
<wsdl:message name="AddSoapIn">
23+
<wsdl:part name="parameters" element="tns:Add" />
24+
</wsdl:message>
25+
<wsdl:message name="AddSoapOut">
26+
<wsdl:part name="parameters" element="tns:AddResponse" />
27+
</wsdl:message>
28+
<wsdl:portType name="CalculatorSoap">
29+
<wsdl:operation name="Add">
30+
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Adds two integers. This is a test WebService. ©DNE Online</wsdl:documentation>
31+
<wsdl:input message="tns:AddSoapIn" />
32+
<wsdl:output message="tns:AddSoapOut" />
33+
</wsdl:operation>
34+
</wsdl:portType>
35+
<wsdl:binding name="CalculatorSoap" type="tns:CalculatorSoap">
36+
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
37+
<wsdl:operation name="Add">
38+
<soap:operation soapAction="http://tempuri.org/Add" style="document" />
39+
<wsdl:input>
40+
<soap:body use="literal" />
41+
</wsdl:input>
42+
<wsdl:output>
43+
<soap:body use="literal" />
44+
</wsdl:output>
45+
</wsdl:operation>
46+
</wsdl:binding>
47+
<wsdl:service name="Calculator">
48+
<wsdl:port name="CalculatorSoap" binding="tns:CalculatorSoap">
49+
<soap:address location="http://www.dneonline.com/calculator.asmx" />
50+
</wsdl:port>
51+
</wsdl:service>
52+
</wsdl:definitions>

0 commit comments

Comments
 (0)