Prevent integer overflow while parsing long strings.

This commit is contained in:
Mike Pall 2019-12-08 19:35:25 +01:00
parent e0388e6c00
commit 16e5605eec

View File

@ -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++;
}