src/network/core/udp.cpp
changeset 8870 b83a4174cf2d
parent 8140 0d0d8c94f84b
child 10015 2b721243365f
equal deleted inserted replaced
8869:8a3dac8dc505 8870:b83a4174cf2d
   218 	switch (info->game_info_version) {
   218 	switch (info->game_info_version) {
   219 		case 4: {
   219 		case 4: {
   220 			GRFConfig **dst = &info->grfconfig;
   220 			GRFConfig **dst = &info->grfconfig;
   221 			uint i;
   221 			uint i;
   222 			uint num_grfs = p->Recv_uint8();
   222 			uint num_grfs = p->Recv_uint8();
       
   223 
       
   224 			/* Broken/bad data. It cannot have that many NewGRFs. */
       
   225 			if (num_grfs > NETWORK_MAX_GRF_COUNT) return;
   223 
   226 
   224 			for (i = 0; i < num_grfs; i++) {
   227 			for (i = 0; i < num_grfs; i++) {
   225 				GRFConfig *c = CallocT<GRFConfig>(1);
   228 				GRFConfig *c = CallocT<GRFConfig>(1);
   226 				this->Recv_GRFIdentifier(p, c);
   229 				this->Recv_GRFIdentifier(p, c);
   227 				this->HandleIncomingNetworkGameInfoGRFConfig(c);
   230 				this->HandleIncomingNetworkGameInfoGRFConfig(c);