Description: Fix stack overflow for vararg functions Author: http://www.lua.org/bugs.html Bug-Debian: https://security-tracker.debian.org/tracker/CVE-2014-5461 Last-Update: <2014-8-27> --- diff --git a/src/ldo.c b/src/ldo.c index d18e33c..bbc219e 100644 --- a/src/ldo.c +++ b/src/ldo.c @@ -323,7 +323,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { 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++)