File tree 3 files changed +21
-1
lines changed 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ PHP NEWS
40
40
. Fixed bug GH-16695 (phar:// tar parser and zero-length file header blocks).
41
41
(nielsdos, Hans Krentel)
42
42
43
+ - SimpleXML:
44
+ . Fixed bug GH-16808 (Segmentation fault in RecursiveIteratorIterator
45
+ ->current() with a xml element input). (nielsdos)
46
+
43
47
- SOAP:
44
48
. Fix make check being invoked in ext/soap. (Ma27)
45
49
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) /* {{{ */
2532
2532
{
2533
2533
php_sxe_iterator * iterator = (php_sxe_iterator * )iter ;
2534
2534
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 ;
2536
2540
}
2537
2541
/* }}} */
2538
2542
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