]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Prevent integer overflow while parsing long strings.
authorMike Pall <mike>
Sun, 8 Dec 2019 18:35:25 +0000 (19:35 +0100)
committerMike Pall <mike>
Sun, 8 Dec 2019 18:35:25 +0000 (19:35 +0100)
src/lj_lex.c

index 3660316801d22dff1cb2fcf02e9b252ed07a63d9..1d063f8f977e76bbfc3f154ddc3efce67f186540 100644 (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++;
   }