(svn r12637) -Fix [FS#1913]: possible NULL pointer dereference when reading some NewGRF data.

This commit is contained in:
rubidium
2008-04-09 14:05:50 +00:00
parent c41624bb94
commit ab7b05da50
2 changed files with 5 additions and 7 deletions

View File

@@ -221,6 +221,9 @@ void NetworkUDPSocketHandler::Recv_NetworkGameInfo(Packet *p, NetworkGameInfo *i
uint i;
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 *c = CallocT<GRFConfig>(1);
this->Recv_GRFIdentifier(p, c);