diff options
author | sfan5 <sfan5@live.de> | 2021-08-19 20:14:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-19 20:14:22 +0200 |
commit | e7b05beb7d90b4ea53ef13da86ff8b8ccde1193b (patch) | |
tree | b87dfaf74cc8443298ad0e00a0381a88ce7c5ade /src/script/lua_api/l_object.cpp | |
parent | 1320c51d8e15409544cba970a97b167a37513bae (diff) | |
download | minetest-e7b05beb7d90b4ea53ef13da86ff8b8ccde1193b.tar.gz minetest-e7b05beb7d90b4ea53ef13da86ff8b8ccde1193b.tar.bz2 minetest-e7b05beb7d90b4ea53ef13da86ff8b8ccde1193b.zip |
Validate staticdata and object property length limits (#11511)
Some games provide users with enough freedom to create items
with metadata longer than 64KB, preventing this from causing
issues is on them but we'll still do the minimum not to abort
the server if this happens.
Diffstat (limited to 'src/script/lua_api/l_object.cpp')
-rw-r--r-- | src/script/lua_api/l_object.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 8e308cd9e..c404cb63c 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -685,6 +685,7 @@ int ObjectRef::l_set_properties(lua_State *L) return 0; read_object_properties(L, 2, sao, prop, getServer(L)->idef()); + prop->validate(); sao->notifyObjectPropertiesModified(); return 0; } @@ -752,6 +753,7 @@ int ObjectRef::l_set_nametag_attributes(lua_State *L) std::string nametag = getstringfield_default(L, 2, "text", ""); prop->nametag = nametag; + prop->validate(); sao->notifyObjectPropertiesModified(); lua_pushboolean(L, true); return 1; |