]> granicus.if.org Git - php/commitdiff
MFB: Improved validation checks inside str_pad()
authorIlia Alshanetsky <iliaa@php.net>
Fri, 30 Jan 2009 00:17:05 +0000 (00:17 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 30 Jan 2009 00:17:05 +0000 (00:17 +0000)
ext/standard/string.c

index d7c3164f8d2ace847b0c50f0c4066545d41fa2bb..e1062afac341a8daca12de4dee7589993c6778dd 100644 (file)
@@ -4922,7 +4922,7 @@ PHP_FUNCTION(str_pad)
 
        /* If resulting string turns out to be shorter than input string,
           we simply copy the input and return. */
-       if (Z_LVAL_PP(pad_length) < 0 || num_pad_chars < 0) {
+       if (Z_LVAL_PP(pad_length) <= 0 || num_pad_chars <= 0) {
                RETURN_ZVAL(*input, 1, 0);
        }