Unverified Commit d75ad774 authored by Yossi Gottlieb's avatar Yossi Gottlieb Committed by GitHub
Browse files

Backport Lua 5.2.2 stack overflow fix. (#7733)

This fixes the issue described in CVE-2014-5461. At this time we cannot
confirm that the original issue has a real impact on Redis, but it is
included as an extra safety measure.
parent 571571ca
...@@ -274,7 +274,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { ...@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment