iliaa Sun Jun 24 17:37:01 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard array.c /php-src NEWS Log: Fixed bug #41685 (array_push() fails to warn when next index is already occupied). http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.29&r2=1.308.2.21.2.30&diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.308.2.21.2.29 php-src/ext/standard/array.c:1.308.2.21.2.30 --- php-src/ext/standard/array.c:1.308.2.21.2.29 Mon Jun 18 16:53:09 2007 +++ php-src/ext/standard/array.c Sun Jun 24 17:37:01 2007 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.308.2.21.2.29 2007/06/18 16:53:09 iliaa Exp $ */ +/* $Id: array.c,v 1.308.2.21.2.30 2007/06/24 17:37:01 iliaa Exp $ */ #include "php.h" #include "php_ini.h" @@ -1957,7 +1957,11 @@ new_var = *args[i]; new_var->refcount++; - zend_hash_next_index_insert(Z_ARRVAL_P(stack), &new_var, sizeof(zval *), NULL); + if (zend_hash_next_index_insert(Z_ARRVAL_P(stack), &new_var, sizeof(zval *), NULL) == FAILURE) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to the array as the next element is already occupied"); + efree(args); + RETURN_FALSE; + } } /* Clean up and return the number of values in the stack */ http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.795&r2=1.2027.2.547.2.796&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.795 php-src/NEWS:1.2027.2.547.2.796 --- php-src/NEWS:1.2027.2.547.2.795 Fri Jun 22 00:10:02 2007 +++ php-src/NEWS Sun Jun 24 17:37:01 2007 @@ -43,6 +43,8 @@ - Fixed bug #41717 (imagepolygon does not respect thickness). (Pierre) - Fixed bug #41686 (Omitting length param in array_slice not possible). (Ilia) +- Fixed bug #41685 (array_push() fails to warn when next index is already + occupied). (Ilia) - Fixed bug #41655 (open_basedir bypass via glob()). (Ilia) - Fixed bug #41640 (get_class_vars produces error on class constants). (Johannes)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php