iliaa           Mon Dec  3 14:13:45 2007 UTC

  Modified files:              
    /php-src/ext/standard       array.c 
  Log:
  
  MFB:  Fixed bug #43482 (array_pad() does not warn on very small pad
  numbers).
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.430&r2=1.431&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.430 php-src/ext/standard/array.c:1.431
--- php-src/ext/standard/array.c:1.430  Sun Nov 25 15:56:58 2007
+++ php-src/ext/standard/array.c        Mon Dec  3 14:13:45 2007
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: array.c,v 1.430 2007/11/25 15:56:58 iliaa Exp $ */
+/* $Id: array.c,v 1.431 2007/12/03 14:13:45 iliaa Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -2684,6 +2684,11 @@
        /* 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 */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to