openbsd-ports/lang/lua/5.1/patches/patch-src_ldo_c
2014-09-09 13:54:43 +00:00

17 lines
743 B
Plaintext

$OpenBSD: patch-src_ldo_c,v 1.2 2014/09/09 13:54:43 jasper Exp $
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);