mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix GH-16808: Segmentation fault in RecursiveIteratorIterator->current() with a xml element input
This commit is contained in:
commit
2ba18590bf
3 changed files with 21 additions and 1 deletions
4
NEWS
4
NEWS
|
@ -40,6 +40,10 @@ PHP NEWS
|
|||
. Fixed bug GH-16695 (phar:// tar parser and zero-length file header blocks).
|
||||
(nielsdos, Hans Krentel)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug GH-16808 (Segmentation fault in RecursiveIteratorIterator
|
||||
->current() with a xml element input). (nielsdos)
|
||||
|
||||
- SOAP:
|
||||
. Fix make check being invoked in ext/soap. (Ma27)
|
||||
|
||||
|
|
|
@ -2532,7 +2532,11 @@ static zval *php_sxe_iterator_current_data(zend_object_iterator *iter) /* {{{ */
|
|||
{
|
||||
php_sxe_iterator *iterator = (php_sxe_iterator *)iter;
|
||||
|
||||
return &iterator->sxe->iter.data;
|
||||
zval *data = &iterator->sxe->iter.data;
|
||||
if (Z_ISUNDEF_P(data)) {
|
||||
return NULL;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
|
12
ext/simplexml/tests/gh16808.phpt
Normal file
12
ext/simplexml/tests/gh16808.phpt
Normal file
|
@ -0,0 +1,12 @@
|
|||
--TEST--
|
||||
GH-16808 (Segmentation fault in RecursiveIteratorIterator->current() with a xml element input)
|
||||
--EXTENSIONS--
|
||||
simplexml
|
||||
--FILE--
|
||||
<?php
|
||||
$sxe = new SimpleXMLElement("<root />");
|
||||
$test = new RecursiveIteratorIterator($sxe);
|
||||
var_dump($test->current());
|
||||
?>
|
||||
--EXPECT--
|
||||
NULL
|
Loading…
Add table
Add a link
Reference in a new issue