jani            Mon Jul 23 13:27:59 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/standard       string.c 
    /php-src/ext/standard/tests/strings str_pad.phpt 
  Log:
  MFH: Fixed str_pad() when passed huge negative pad length.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.64&r2=1.445.2.14.2.65&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.64 
php-src/ext/standard/string.c:1.445.2.14.2.65
--- php-src/ext/standard/string.c:1.445.2.14.2.64       Sun Jul 22 15:55:15 2007
+++ php-src/ext/standard/string.c       Mon Jul 23 13:27:58 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.64 2007/07/22 15:55:15 iliaa Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.65 2007/07/23 13:27:58 jani Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -4746,7 +4746,7 @@
 
        /* If resulting string turns out to be shorter than input string,
           we simply copy the input and return. */
-       if (num_pad_chars < 0) {
+       if (Z_LVAL_PP(pad_length) < 0 || num_pad_chars < 0) {
                RETURN_ZVAL(*input, 1, 0);
        }
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/str_pad.phpt?r1=1.1.2.4&r2=1.1.2.5&diff_format=u
Index: php-src/ext/standard/tests/strings/str_pad.phpt

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

Reply via email to