Skip to content

Commit 4b343a0

Browse files
committed
MFB
1 parent 1ad9bd6 commit 4b343a0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/standard/array.c

+4
Original file line numberDiff line numberDiff line change
@@ -2465,6 +2465,10 @@ PHP_FUNCTION(array_pad)
24652465

24662466
/* Populate the pads array */
24672467
num_pads = pad_size_abs - input_size;
2468+
if(num_pads > 1048576) {
2469+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad up to 1048576 elements at a time");
2470+
RETURN_FALSE;
2471+
}
24682472
pads = (zval ***)emalloc(num_pads * sizeof(zval **));
24692473
for (i = 0; i < num_pads; i++) {
24702474
pads[i] = pad_value;

0 commit comments

Comments
 (0)