mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix zero-extension on range() char parameters
This commit is contained in:
@@ -3049,9 +3049,9 @@ PHP_FUNCTION(range)
|
||||
goto handle_numeric_inputs;
|
||||
}
|
||||
|
||||
/* Generate array of characters, as ints to make bounds checking possible in the loop condition */
|
||||
int low = Z_STRVAL_P(user_start)[0];
|
||||
int high = Z_STRVAL_P(user_end)[0];
|
||||
/* Generate array of characters, as zero-extended ints to make bounds checking possible in the loop condition */
|
||||
int low = (unsigned char) Z_STRVAL_P(user_start)[0];
|
||||
int high = (unsigned char) Z_STRVAL_P(user_end)[0];
|
||||
|
||||
/* Decreasing char range */
|
||||
if (low > high) {
|
||||
|
||||
Reference in New Issue
Block a user