lua: fix CVE-2014-5461
[openwrt/staging/jow.git] / package / utils / lua / patches / 400-CVE-2014-5461.patch
1 From: Enrico Tassi <gareuselesinge@debian.org>
2 Date: Tue, 26 Aug 2014 16:20:55 +0200
3 Subject: Fix stack overflow in vararg functions
4
5 ---
6 src/ldo.c | 2 +-
7 1 file changed, 1 insertion(+), 1 deletion(-)
8
9 --- a/src/ldo.c
10 +++ b/src/ldo.c
11 @@ -274,7 +274,7 @@ int luaD_precall (lua_State *L, StkId fu
12 CallInfo *ci;
13 StkId st, base;
14 Proto *p = cl->p;
15 - luaD_checkstack(L, p->maxstacksize);
16 + luaD_checkstack(L, p->maxstacksize + p->numparams);
17 func = restorestack(L, funcr);
18 if (!p->is_vararg) { /* no varargs? */
19 base = func + 1;