浏览代码

Prevent integer overflow while parsing long strings.

Mike Pall 5 年之前
父节点
当前提交
16e5605eec
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/lj_lex.c

+ 1 - 1
src/lj_lex.c

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