From: SmallJoker Date: Wed, 26 Jun 2019 17:37:14 +0000 (+0200) Subject: CSM: Fix itemstack:get_meta() 'metadata' indexing error X-Git-Tag: 5.1.0~50 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b0baa698a495cc990ce5d9c22763957f1138aed3;p=oweals%2Fminetest.git CSM: Fix itemstack:get_meta() 'metadata' indexing error --- diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp index d972be980..b90b3aa2c 100644 --- a/src/script/cpp_api/s_security.cpp +++ b/src/script/cpp_api/s_security.cpp @@ -243,6 +243,7 @@ void ScriptApiSecurity::initializeSecurityClient() "rawset", "select", "setfenv", + // getmetatable can be used to escape the sandbox "setmetatable", "tonumber", "tostring", diff --git a/src/script/scripting_client.cpp b/src/script/scripting_client.cpp index 239c98e57..c3e0ca373 100644 --- a/src/script/scripting_client.cpp +++ b/src/script/scripting_client.cpp @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "lua_api/l_client.h" #include "lua_api/l_env.h" #include "lua_api/l_item.h" +#include "lua_api/l_itemstackmeta.h" #include "lua_api/l_minimap.h" #include "lua_api/l_modchannels.h" #include "lua_api/l_particles_local.h" @@ -67,6 +68,7 @@ ClientScripting::ClientScripting(Client *client): void ClientScripting::InitializeModApi(lua_State *L, int top) { LuaItemStack::Register(L); + ItemStackMetaRef::Register(L); StorageRef::Register(L); LuaMinimap::Register(L); NodeMetaRef::RegisterClient(L);