File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ PHP NEWS
4040 . Fixed bug GH-16695 (phar:// tar parser and zero-length file header blocks).
4141 (nielsdos, Hans Krentel)
4242
43+ - SimpleXML:
44+ . Fixed bug GH-16808 (Segmentation fault in RecursiveIteratorIterator
45+ ->current() with a xml element input). (nielsdos)
46+
4347- SOAP:
4448 . Fix make check being invoked in ext/soap. (Ma27)
4549
Original file line number Diff line number Diff line change @@ -2532,7 +2532,11 @@ static zval *php_sxe_iterator_current_data(zend_object_iterator *iter) /* {{{ */
25322532{
25332533 php_sxe_iterator * iterator = (php_sxe_iterator * )iter ;
25342534
2535- return & iterator -> sxe -> iter .data ;
2535+ zval * data = & iterator -> sxe -> iter .data ;
2536+ if (Z_ISUNDEF_P (data )) {
2537+ return NULL ;
2538+ }
2539+ return data ;
25362540}
25372541/* }}} */
25382542
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-16808 (Segmentation fault in RecursiveIteratorIterator->current() with a xml element input)
3+ --EXTENSIONS--
4+ simplexml
5+ --FILE--
6+ <?php
7+ $ sxe = new SimpleXMLElement ("<root /> " );
8+ $ test = new RecursiveIteratorIterator ($ sxe );
9+ var_dump ($ test ->current ());
10+ ?>
11+ --EXPECT--
12+ NULL
You can’t perform that action at this time.
0 commit comments