mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.4'
* PHP-8.4: Fix GH-16429: Segmentation fault (access null pointer) in SoapClient
This commit is contained in:
commit
275c7f21ab
2 changed files with 25 additions and 2 deletions
|
@ -2268,8 +2268,8 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
|
||||||
|
|
||||||
iter = ce->get_iterator(ce, data, 0);
|
iter = ce->get_iterator(ce, data, 0);
|
||||||
|
|
||||||
if (EG(exception)) {
|
if (!iter) {
|
||||||
goto iterator_done;
|
goto iterator_failed_to_get;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iter->funcs->rewind) {
|
if (iter->funcs->rewind) {
|
||||||
|
@ -2309,6 +2309,7 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
|
||||||
}
|
}
|
||||||
iterator_done:
|
iterator_done:
|
||||||
OBJ_RELEASE(&iter->std);
|
OBJ_RELEASE(&iter->std);
|
||||||
|
iterator_failed_to_get:
|
||||||
if (EG(exception)) {
|
if (EG(exception)) {
|
||||||
zval_ptr_dtor(&array_copy);
|
zval_ptr_dtor(&array_copy);
|
||||||
ZVAL_UNDEF(&array_copy);
|
ZVAL_UNDEF(&array_copy);
|
||||||
|
|
22
ext/soap/tests/bugs/gh16429.phpt
Normal file
22
ext/soap/tests/bugs/gh16429.phpt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
--TEST--
|
||||||
|
GH-16429 (Segmentation fault (access null pointer) in SoapClient)
|
||||||
|
--EXTENSIONS--
|
||||||
|
soap
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function gen() {
|
||||||
|
var_dump(str_repeat("x", yield));
|
||||||
|
}
|
||||||
|
$gen = gen();
|
||||||
|
$gen->send(10);
|
||||||
|
$fusion = $gen;
|
||||||
|
$client = new SoapClient(__DIR__."/../interop/Round2/GroupB/round2_groupB.wsdl",array("trace"=>1,"exceptions"=>0));
|
||||||
|
try {
|
||||||
|
$client->echo2DStringArray($fusion);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
string(10) "xxxxxxxxxx"
|
||||||
|
Cannot traverse an already closed generator
|
Loading…
Add table
Add a link
Reference in a new issue