diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2007-12-03 14:13:27 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2007-12-03 14:13:27 +0000 |
commit | 7192e8af1531a1ed5568c415b75796f626a7abb2 (patch) | |
tree | 159657dd5c26b500f4984beec7e596f2076b3ea6 | |
parent | b70d00a64807822b32d7d404d9bfc54580d01a39 (diff) | |
download | php-git-7192e8af1531a1ed5568c415b75796f626a7abb2.tar.gz |
MFB: Fixed bug #43482 (array_pad() does not warn on very small pad
numbers).
-rw-r--r-- | ext/standard/array.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 8c21e486c5..3b19bcd7dd 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2473,6 +2473,11 @@ PHP_FUNCTION(array_pad) /* Do some initial calculations */ input_size = zend_hash_num_elements(Z_ARRVAL_P(input)); pad_size_abs = abs(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 */ |