Commits

Harald Klimach committed 3d8ac1e

Applied patch 1 for Lua 5.2.2
Stack overflow in vararg functions with many fixed parameters called with few arguments.

  • Participants
  • Parent commits 449bc76

Comments (0)

Files changed (1)

external/lua-5.2.2/src/ldo.c

     case LUA_TLCL: {  /* Lua function: prepare its call */
       StkId base;
       Proto *p = clLvalue(func)->p;
-      luaD_checkstack(L, p->maxstacksize);
+      luaD_checkstack(L, p->maxstacksize + p->numparams);
       func = restorestack(L, funcr);
       n = cast_int(L->top - func) - 1;  /* number of real arguments */
       for (; n < p->numparams; n++)