1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00

MFB: Improved validation checks inside str_pad()

This commit is contained in:
Ilia Alshanetsky
2009-01-30 00:17:05 +00:00
parent d84d3e47f3
commit adfdb7a77f
+1 -1
View 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);
}