src/network/core/udp.cpp
branchNewGRF_ports
changeset 10184 fcf5fb2548eb
parent 6872 1c4a4a609f85
--- a/src/network/core/udp.cpp	Mon Apr 14 20:32:36 2008 +0000
+++ b/src/network/core/udp.cpp	Tue Apr 15 00:47:19 2008 +0000
@@ -221,6 +221,9 @@
 			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);