fix out of bounds string access in isUsingDecl

This commit is contained in:
erik-krogh
2023-09-13 20:11:21 +02:00
parent e109892388
commit fdd349c1a3
3 changed files with 12 additions and 4 deletions

View File

@@ -2708,7 +2708,8 @@ public class Parser {
Matcher m = Whitespace.skipWhiteSpace.matcher(this.input);
m.find(this.pos);
int next = m.end();
return !Whitespace.lineBreakG.matcher(inputSubstring(this.pos, next)).matches()
return this.input.length() > next &&
!Whitespace.lineBreakG.matcher(inputSubstring(this.pos, next)).matches()
&& Identifiers.isIdentifierChar(this.input.codePointAt(next), false);
}