mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #78454: Consecutive numeric separators cause OOM error
This commit is contained in:
commit
c8ec166cda
3 changed files with 16 additions and 2 deletions
7
Zend/tests/bug78454_1.phpt
Normal file
7
Zend/tests/bug78454_1.phpt
Normal file
|
@ -0,0 +1,7 @@
|
|||
--TEST--
|
||||
Invalid consecutive numeric separators after hex literal
|
||||
--FILE--
|
||||
<?php
|
||||
0x0__F;
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected '__F' (T_STRING) in %s on line %d
|
7
Zend/tests/bug78454_2.phpt
Normal file
7
Zend/tests/bug78454_2.phpt
Normal file
|
@ -0,0 +1,7 @@
|
|||
--TEST--
|
||||
Invalid consecutive numeric separators after binary literal
|
||||
--FILE--
|
||||
<?php
|
||||
0b0__1
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected '__1' (T_STRING) in %s on line %d
|
|
@ -1775,7 +1775,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
|||
char *end, *bin = yytext + 2;
|
||||
|
||||
/* Skip any leading 0s */
|
||||
while (*bin == '0' || *bin == '_') {
|
||||
while (len > 0 && (*bin == '0' || *bin == '_')) {
|
||||
++bin;
|
||||
--len;
|
||||
}
|
||||
|
@ -1892,7 +1892,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
|||
char *end, *hex = yytext + 2;
|
||||
|
||||
/* Skip any leading 0s */
|
||||
while (*hex == '0' || *hex == '_') {
|
||||
while (len > 0 && (*hex == '0' || *hex == '_')) {
|
||||
++hex;
|
||||
--len;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue