We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b5211b commit 678c532Copy full SHA for 678c532
ext/standard/array.c
@@ -2684,6 +2684,11 @@ PHP_FUNCTION(array_pad)
2684
/* Do some initial calculations */
2685
input_size = zend_hash_num_elements(Z_ARRVAL_P(input));
2686
pad_size_abs = abs(pad_size);
2687
+ if (pad_size_abs < 0) {
2688
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad up to 1048576 elements at a time");
2689
+ zval_dtor(return_value);
2690
+ RETURN_FALSE;
2691
+ }
2692
do_pad = (input_size >= pad_size_abs) ? 0 : 1;
2693
2694
/* Copy the original array */
0 commit comments