Discarded math.random, as it is an OoS-magnet.

This commit is contained in:
Guillaume Melquiond 2010-07-19 20:52:17 +00:00
parent 62d46ebc5e
commit 3769893731

View file

@ -2241,6 +2241,12 @@ LuaKernel::LuaKernel()
lua_setfield(L, -2, "wml_actions");
lua_pop(L, 1);
// Remove the math.random function, since it is not OoS-proof.
lua_getglobal(L, "math");
lua_pushnil(L);
lua_setfield(L, -2, "random");
lua_pop(L, 1);
// Store the error handler, then close debug.
lua_pushlightuserdata(L, (void *)&executeKey);
lua_getglobal(L, "debug");