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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user