Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #78454: Consecutive numeric separators cause OOM error
This commit is contained in:
Christoph M. Becker 2019-08-25 22:46:55 +02:00
commit c8ec166cda
3 changed files with 16 additions and 2 deletions

View 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

View 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

View file

@ -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;
}