Skip to content

Commit

Permalink
Prevent integer overflow while parsing long strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Pall committed Dec 8, 2019
1 parent e0388e6 commit 16e5605
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lj_lex.c
Expand Up @@ -140,7 +140,7 @@ static int skip_sep(LexState *ls)
int s = ls->current;
lua_assert(s == '[' || s == ']');
save_and_next(ls);
while (ls->current == '=') {
while (ls->current == '=' && count < 0x20000000) {
save_and_next(ls);
count++;
}
Expand Down

0 comments on commit 16e5605

Please sign in to comment.