mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX)
This commit is contained in:
parent
2e61d04f49
commit
c578917e30
4
NEWS
4
NEWS
@ -45,6 +45,10 @@ PHP NEWS
|
||||
. Fixed bug #60968 (Late static binding doesn't work with
|
||||
ReflectionMethod::invokeArgs()). (Laruence)
|
||||
|
||||
- Array:
|
||||
. Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX).
|
||||
(Laruence)
|
||||
|
||||
?? ??? 2012, PHP 5.3.10
|
||||
|
||||
(to be added)
|
||||
|
@ -1558,11 +1558,15 @@ PHP_FUNCTION(array_fill)
|
||||
|
||||
num--;
|
||||
zval_add_ref(&val);
|
||||
zend_hash_index_update(Z_ARRVAL_P(return_value), start_key, &val, sizeof(zval *), NULL);
|
||||
if (zend_hash_index_update(Z_ARRVAL_P(return_value), start_key, &val, sizeof(zval *), NULL) == FAILURE) {
|
||||
zval_ptr_dtor(&val);
|
||||
}
|
||||
|
||||
while (num--) {
|
||||
zval_add_ref(&val);
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &val, sizeof(zval *), NULL);
|
||||
if (zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &val, sizeof(zval *), NULL) == FAILURE) {
|
||||
zval_ptr_dtor(&val);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
Loading…
Reference in New Issue
Block a user