void-packages/srcpkgs/lua51/patches/CVE-2014-5461.patch

15 lines
677 B
Diff

Security fix for CVE-2014-5461,
http://openwall.com/lists/oss-security/2014/08/27/2
--- src/ldo.c.orig Tue Sep 9 15:32:24 2014
+++ src/ldo.c Tue Sep 9 15:33:46 2014
@@ -217,7 +217,7 @@ static StkId adjust_varargs (lua_State *L, Proto *p, i
int nvar = actual - nfixargs; /* number of extra arguments */
lua_assert(p->is_vararg & VARARG_HASARG);
luaC_checkGC(L);
- luaD_checkstack(L, p->maxstacksize);
+ luaD_checkstack(L, p->maxstacksize + p->numparams);
htab = luaH_new(L, nvar, 1); /* create `arg' table */
for (i=0; i<nvar; i++) /* put extra arguments into `arg' table */
setobj2n(L, luaH_setnum(L, htab, i+1), L->top - nvar + i);