This commit is contained in:
Rasmus Lerdorf 2003-04-01 21:47:21 +00:00
parent 1ad9bd68ff
commit 4b343a0562

View File

@ -2465,6 +2465,10 @@ PHP_FUNCTION(array_pad)
/* Populate the pads array */
num_pads = pad_size_abs - input_size;
if(num_pads > 1048576) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You may only pad up to 1048576 elements at a time");
RETURN_FALSE;
}
pads = (zval ***)emalloc(num_pads * sizeof(zval **));
for (i = 0; i < num_pads; i++) {
pads[i] = pad_value;