Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: NEWS for #66049 Fix #66049 Typemap can break parsing in parse_packet_soap leading to a segfault
This commit is contained in:
@ -192,6 +192,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
|
||||
if (tmp != NULL && tmp->children != NULL) {
|
||||
zval zv;
|
||||
master_to_zval(&zv, get_conversion(IS_STRING), tmp);
|
||||
convert_to_string(&zv)
|
||||
faultstring = Z_STR(zv);
|
||||
}
|
||||
|
||||
@ -199,6 +200,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
|
||||
if (tmp != NULL && tmp->children != NULL) {
|
||||
zval zv;
|
||||
master_to_zval(&zv, get_conversion(IS_STRING), tmp);
|
||||
convert_to_string(&zv)
|
||||
faultactor = Z_STR(zv);
|
||||
}
|
||||
|
||||
@ -222,6 +224,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
|
||||
if (tmp != NULL && tmp->children != NULL) {
|
||||
zval zv;
|
||||
master_to_zval(&zv, get_conversion(IS_STRING), tmp);
|
||||
convert_to_string(&zv)
|
||||
faultstring = Z_STR(zv);
|
||||
}
|
||||
}
|
||||
|
48
ext/soap/tests/bugs/bug66049.phpt
Normal file
48
ext/soap/tests/bugs/bug66049.phpt
Normal file
@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Fix #66049 Typemap can break parsing in parse_packet_soap leading to a segfault
|
||||
--EXTENSIONS--
|
||||
soap
|
||||
--INI--
|
||||
soap.wsdl_cache_enabled=0
|
||||
--FILE--
|
||||
<?php
|
||||
function soap_string_from_xml($str)
|
||||
{
|
||||
echo "soap_string_from_xml\n";
|
||||
|
||||
// Should return an string
|
||||
return 2.3;
|
||||
}
|
||||
|
||||
class TestSoapClient extends SoapClient {
|
||||
function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
|
||||
$res='<?xml version="1.0" encoding="UTF-8"?>
|
||||
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
|
||||
<SOAP-ENV:Body>
|
||||
<SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>not present</faultstring>
|
||||
</SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>';
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$client=new TestSoapClient(null, [
|
||||
'uri' => 'test://',
|
||||
'location' => 'test://',
|
||||
'typemap' => [[
|
||||
"type_ns" => "http://www.w3.org/2001/XMLSchema",
|
||||
"type_name" => "string",
|
||||
"from_xml" => "soap_string_from_xml"
|
||||
]]]);
|
||||
$client->Mist("");
|
||||
} catch (SoapFault $e) {
|
||||
var_dump($e->faultstring);
|
||||
var_dump($e->faultcode);
|
||||
}
|
||||
?>
|
||||
Done
|
||||
--EXPECT--
|
||||
soap_string_from_xml
|
||||
string(3) "2.3"
|
||||
string(15) "SOAP-ENV:Server"
|
||||
Done
|
Reference in New Issue
Block a user