Merge branch 'master' into jgrpp
# Conflicts: # src/3rdparty/fmt/core.h # src/command_type.h # src/console_cmds.cpp # src/core/overflowsafe_type.hpp # src/landscape.cpp # src/network/network.cpp # src/newgrf_object.h # src/object_cmd.cpp # src/order_gui.cpp # src/saveload/vehicle_sl.cpp # src/script/api/script_industrytype.cpp # src/script/api/script_object.hpp # src/script/api/script_town.cpp # src/table/object_land.h # src/timetable_cmd.cpp # src/tree_cmd.cpp # src/vehicle_gui.cpp # src/window.cpp
This commit is contained in:
@@ -358,14 +358,14 @@ void DeserializeNetworkGameInfo(Packet *p, NetworkGameInfo *info, const GameInfo
|
||||
}
|
||||
|
||||
case 4: {
|
||||
GRFConfig **dst = &info->grfconfig;
|
||||
uint i;
|
||||
/* Ensure that the maximum number of NewGRFs and the field in the network
|
||||
* protocol are matched to eachother. If that is not the case anymore a
|
||||
* check must be added to ensure the received data is still valid. */
|
||||
static_assert(std::numeric_limits<uint8>::max() == NETWORK_MAX_GRF_COUNT);
|
||||
uint num_grfs = p->Recv_uint8();
|
||||
|
||||
/* Broken/bad data. It cannot have that many NewGRFs. */
|
||||
if (num_grfs > NETWORK_MAX_GRF_COUNT) return;
|
||||
|
||||
for (i = 0; i < num_grfs; i++) {
|
||||
GRFConfig **dst = &info->grfconfig;
|
||||
for (uint i = 0; i < num_grfs; i++) {
|
||||
NamedGRFIdentifier grf;
|
||||
switch (newgrf_serialisation) {
|
||||
case NST_GRFID_MD5:
|
||||
|
||||
Reference in New Issue
Block a user