svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/array.c trunk/NEWS trunk/ext/standard/array.c
| From: | Xinchen Hui | Date: | Sun, 12 Feb 2012 04:59:08 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/array.c trunk/NEWS trunk/ext/standard/array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-67659@lists.php.net to get a copy of this message | ||
laruence Sun, 12 Feb 2012 04:59:08 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=323160
Log:
Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX)
Bug: https://bugs.php.net/61058 (Open) array_fill leaks if
start index is PHP_INT_MAX
Changed paths:
U php/php-src/branches/PHP_5_3/NEWS
U php/php-src/branches/PHP_5_3/ext/standard/array.c
U php/php-src/trunk/NEWS
U php/php-src/trunk/ext/standard/array.c
Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS 2012-02-11 13:34:06 UTC (rev 323159)
+++ php/php-src/branches/PHP_5_3/NEWS 2012-02-12 04:59:08 UTC (rev 323160)
@@ -45,6 +45,10 @@
. 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)
Modified: php/php-src/branches/PHP_5_3/ext/standard/array.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/array.c 2012-02-11 13:34:06 UTC (rev 323159)
+++ php/php-src/branches/PHP_5_3/ext/standard/array.c 2012-02-12 04:59:08 UTC (rev 323160)
@@ -1558,11 +1558,15 @@
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);
+ }
}
}
/* }}} */
Modified: php/php-src/trunk/NEWS
===================================================================
--- php/php-src/trunk/NEWS 2012-02-11 13:34:06 UTC (rev 323159)
+++ php/php-src/trunk/NEWS 2012-02-12 04:59:08 UTC (rev 323160)
@@ -42,4 +42,8 @@
. 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)
+
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
Modified: php/php-src/trunk/ext/standard/array.c
===================================================================
--- php/php-src/trunk/ext/standard/array.c 2012-02-11 13:34:06 UTC (rev 323159)
+++ php/php-src/trunk/ext/standard/array.c 2012-02-12 04:59:08 UTC (rev 323160)
@@ -1564,11 +1564,15 @@
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);
+ }
}
}
/* }}} */