Don't serialize StaticObjectList with > 65535 objects
authorKahrl <kahrl@gmx.net>
Mon, 28 Sep 2015 23:55:12 +0000 (01:55 +0200)
committerKahrl <kahrl@gmx.net>
Mon, 28 Sep 2015 23:55:12 +0000 (01:55 +0200)
commit0cde03254a6564eaec21603e9add4f14e6c2fe52
treeffe8ccdecd450f8a8c419936415b3e35b8b2c529
parentffe291cb78fc7135034fe6456b2d7dfc3761dc52
Don't serialize StaticObjectList with > 65535 objects

Because the count is serialized as u16, this would cause overflow.

If minetest later deserialized a mapblock with an incorrect
static object count, it would be unable to find the NameIdMapping
(which comes after the StaticObjectList) and abort with an error
such as "Invalid block data in database: unsupported NameIdMapping
version" (issue #2610).
src/staticobject.cpp