1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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.
This commit is contained in:
sfan5 2021-08-19 20:14:22 +02:00 committed by GitHub
parent 1320c51d8e
commit e7b05beb7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 1 deletions

View file

@ -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;