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
JavaScriptParser.ParseProgram sometimes throws ArgumentOutOfRangeException (this is different from the ArgumentOutOfRangeException found in sebastienros/jint#571). Here is the complete C# program for reproducing the issue:
using Esprima;namespace esprima.Run
{publicclassProgram{publicstaticvoidMain(string[]args){varparser=new JavaScriptParser("Fu>\\u{ddee}\\u{dn");
parser.ParseProgram();}}}
The stack trace:
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in System.Private.CoreLib.dll: 'A valid UTF32 value is between 0x000000 and 0x10ffff, inclusive, and should not include surrogate codepoint values (0x00d800 ~ 0x00dfff).'
at System.Char.ConvertFromUtf32(Int32 utf32)
at Esprima.Scanner.GetComplexIdentifier()
at Esprima.Scanner.ScanIdentifier()
at Esprima.JavaScriptParser.NextToken()
at Esprima.JavaScriptParser.ParseBinaryExpression()
at Esprima.JavaScriptParser.InheritCoverGrammar[T](Func`1 parseFunction)
at Esprima.JavaScriptParser.ParseConditionalExpression()
at Esprima.JavaScriptParser.ParseAssignmentExpression()
at Esprima.JavaScriptParser.IsolateCoverGrammar[T](Func`1 parseFunction)
at Esprima.JavaScriptParser.ParseExpression()
at Esprima.JavaScriptParser.ParseLabelledStatement()
at Esprima.JavaScriptParser.ParseStatement()
at Esprima.JavaScriptParser.ParseStatementListItem()
at Esprima.JavaScriptParser.ParseProgram(Boolean strict)
I was using JavascriptPaser to validate user provided scripts while using jint v2.
It was throwing ParserException with the line number, column and description information.
But now with v3, JavascriptParser's ParseProgram throws ArgumentOutOfRangeException without any information.
Btw, if i use Escape's JavascriptParser, ParseProgram still throws ParserException.
JavaScriptParser.ParseProgram sometimes throws ArgumentOutOfRangeException (this is different from the ArgumentOutOfRangeException found in sebastienros/jint#571). Here is the complete C# program for reproducing the issue:
The stack trace:
Found via SharpFuzz.
The text was updated successfully, but these errors were encountered: