You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Missing EOF check in TokenStream#readTemplateLiteral causes OutOfMemoryError when parsing a malformed Unicode code point escape in a template literal. The for loop on line 1609 of TokenStream:
repeats until an OutOfMemoryError is raised because neither a } nor a ` character is encountered before the end of the input.
Input:
`\u{8
Expected Output: A syntax error
Actual Output:
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:649)
at java.lang.StringBuilder.append(StringBuilder.java:202)
at org.mozilla.javascript.TokenStream.getTemplateLiteralChar(TokenStream.java:1480)
at org.mozilla.javascript.TokenStream.peekTemplateLiteralChar(TokenStream.java:1499)
at org.mozilla.javascript.TokenStream.readTemplateLiteral(TokenStream.java:1610)
The text was updated successfully, but these errors were encountered:
Rhino Version: 1.7.14
Java Version: OpenJDK 11.0.19
Missing EOF check in TokenStream#readTemplateLiteral causes OutOfMemoryError when parsing a malformed Unicode code point escape in a template literal. The for loop on line 1609 of TokenStream:
rhino/src/org/mozilla/javascript/TokenStream.java
Line 1609 in 5a0e5b3
Input:
Expected Output: A syntax error
Actual Output:
The text was updated successfully, but these errors were encountered: