mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 09:05:19 +02: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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user