PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2008, PHP 5.2.6
+- Fixed bug #43482 (array_pad() does not warn on very small pad numbers).
+ (Ilia)
- Fixed bug #43457 (Prepared statement with incorrect parms doens't
throw exception with pdo_pgsql driver). (Ilia)
- Fixed bug #43386 (array_globals not reset to 0 properly on init). (Ilia)
/* Do some initial calculations */
input_size = zend_hash_num_elements(Z_ARRVAL_PP(input));
pad_size_abs = abs(Z_LVAL_PP(pad_size));
+ if (pad_size_abs < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad up to 1048576 elements at a time");
+ zval_dtor(return_value);
+ RETURN_FALSE;
+ }
do_pad = (input_size >= pad_size_abs) ? 0 : 1;
/* Copy the original array */