lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> luaU_undump recursively parses its input but does not respect
> LUAI_MAXCCALLS, so a maliciously crafted input can blow the C stack.

Here is a fix:

static Proto* LoadFunction(LoadState* S, TString* p)
{
 Proto* f;
 if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
 f=luaF_newproto(S->L);
 ...
 S->L->nCcalls--;
 return f;
}