mail[Wesnoth-commits] r44406 - /trunk/src/scripting/lua.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on July 19, 2010 - 22:52:
Author: silene
Date: Mon Jul 19 22:52:17 2010
New Revision: 44406

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44406&view=rev
Log:
Discarded math.random, as it is an OoS-magnet.

Modified:
    trunk/src/scripting/lua.cpp

Modified: trunk/src/scripting/lua.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/scripting/lua.cpp?rev=44406&r1=44405&r2=44406&view=diff
==============================================================================
--- trunk/src/scripting/lua.cpp (original)
+++ trunk/src/scripting/lua.cpp Mon Jul 19 22:52:17 2010
@@ -2241,6 +2241,12 @@
        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");




Related Messages


Powered by MHonArc, Updated Mon Jul 19 23:40:12 2010