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
I am using handlebars.js, which uses the lexer of jison in the source code. I found out that an invalid template can crash the library at the lexer generated by jison.
- cleanup: clean up the lexer condition stack better by better matching `pushState()` actions with their matching `popState()` counterparts: this is non-trivial in the current lexer grammar though...
- defensive coding: fix situations like zaach/jison#358 / handlebars-lang/handlebars.js#1368 in the spurious case where the lexer `parseError()` API is invoked *before* the `setInput()` API is invoked (which would *always* set up a non-NULL (though possibly *empty*) `this.yy` lexer context. (Original jison (https://github.com/zaach/jison) doesn't do the latter either, BTW)
GerHobbelt
added a commit
to GerHobbelt/jison-lex
that referenced
this issue
Aug 27, 2017
…ng/handlebars.js#1368 in the spurious case where the lexer `parseError()` API is invoked *before* the `setInput()` API is invoked (which would *always* set up a non-NULL (though possibly *empty*) `this.yy` lexer context. (Original jison (https://github.com/zaach/jison) doesn't do the latter either, BTW)
GerHobbelt
added a commit
to GerHobbelt/ebnf-parser
that referenced
this issue
Aug 27, 2017
I am using handlebars.js, which uses the lexer of jison in the source code. I found out that an invalid template can crash the library at the lexer generated by jison.
The following JSFiddle reproduces the error.
To fix the bug, you may change the if condition
if (this.yy.parser)
at line 1988 of handlebars.jsto if (this.yy && this.yy.parser)
.The text was updated successfully, but these errors were encountered: