com php-src: fixed array_pad(): ext/standard/array. c
| From: | Anatol Belski | Date: | Thu, 21 Aug 2014 20:13:22 +0000 |
| Subject: | com php-src: fixed array_pad(): ext/standard/array. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-80694@lists.php.net to get a copy of this message | ||
Commit: 9d760498c13deff1610e2fe5190955632457c75d
Author: Anatol Belski <ab@php.net> Thu, 21 Aug 2014 22:13:22 +0200
Parents: 96a570cb0384b4f18de99699c893fb24972b7912
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9d760498c13deff1610e2fe5190955632457c75d
Log:
fixed array_pad()
Changed paths:
M ext/standard/array.c
Diff:
diff --git a/ext/standard/array.c b/ext/standard/array.c
index da6122b..22a2694 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2812,8 +2812,8 @@ PHP_FUNCTION(array_pad)
HashTable old_hash;
php_int_t pad_size; /* Size to pad to */
php_int_t pad_size_abs; /* Absolute value of pad_size */
- int input_size; /* Size of the input array */
- int num_pads; /* How many pads do we need */
+ php_int_t input_size; /* Size of the input array */
+ php_int_t num_pads; /* How many pads do we need */
int do_pad; /* Whether we should do padding at all */
int i;
@@ -2841,7 +2841,7 @@ PHP_FUNCTION(array_pad)
/* Populate the pads array */
num_pads = pad_size_abs - input_size;
- if (num_pads > 1048576) {
+ if (num_pads > Z_I(1048576)) {
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;