mirror of
https://github.com/php/php-src.git
synced 2024-12-11 19:04:38 +08:00
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fixed bug #76367 (NoRewindIterator segfault 11)
This commit is contained in:
commit
dc461d6f56
@ -1039,7 +1039,7 @@ static zval *spl_array_it_get_current_data(zend_object_iterator *iter) /* {{{ */
|
|||||||
return zend_user_it_get_current_data(iter);
|
return zend_user_it_get_current_data(iter);
|
||||||
} else {
|
} else {
|
||||||
zval *data = zend_hash_get_current_data_ex(aht, spl_array_get_pos_ptr(aht, object));
|
zval *data = zend_hash_get_current_data_ex(aht, spl_array_get_pos_ptr(aht, object));
|
||||||
if (Z_TYPE_P(data) == IS_INDIRECT) {
|
if (data && Z_TYPE_P(data) == IS_INDIRECT) {
|
||||||
data = Z_INDIRECT_P(data);
|
data = Z_INDIRECT_P(data);
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
|
16
ext/spl/tests/bug76367.phpt
Normal file
16
ext/spl/tests/bug76367.phpt
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
--TEST--
|
||||||
|
Bug #76367 (NoRewindIterator segfault 11)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$arr = [1,3,55,66,43,6];
|
||||||
|
|
||||||
|
$iter = new NoRewindIterator(new ArrayIterator($arr));
|
||||||
|
|
||||||
|
while($iter->valid()) {
|
||||||
|
$iter->next();
|
||||||
|
}
|
||||||
|
|
||||||
|
var_dump($iter->current());
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
NULL
|
Loading…
Reference in New Issue
Block a user