mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
lua: apply patch for "Stack overflow in vararg functions with many fixed parameters called with few arguments"
known as CVE-2014-5461 <https://sources.debian.org/src/lua5.1/5.1.5-9/debian/patches/0004-Fix-stack-overflow-in-vararg-functions.patch/>
This commit is contained in:
parent
9a1501ae89
commit
c1520c9e11
@ -274,7 +274,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) {
|
|||||||
CallInfo *ci;
|
CallInfo *ci;
|
||||||
StkId st, base;
|
StkId st, base;
|
||||||
Proto *p = cl->p;
|
Proto *p = cl->p;
|
||||||
luaD_checkstack(L, p->maxstacksize);
|
luaD_checkstack(L, p->maxstacksize + p->numparams);
|
||||||
func = restorestack(L, funcr);
|
func = restorestack(L, funcr);
|
||||||
if (!p->is_vararg) { /* no varargs? */
|
if (!p->is_vararg) { /* no varargs? */
|
||||||
base = func + 1;
|
base = func + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user