forked from mirror/OpenTTD
(svn r4291) - Fix: validate all received strings for correctness. This fixes potential crashes on invalid clients/servers (thanks test for bringing this to our attention)
This commit is contained in:
@@ -134,9 +134,6 @@ DEF_UDP_RECEIVE_COMMAND(PACKET_UDP_SERVER_RESPONSE)
|
||||
item->info.map_set = NetworkRecv_uint8(&_udp_cs, p);
|
||||
item->info.dedicated = NetworkRecv_uint8(&_udp_cs, p);
|
||||
|
||||
str_validate(item->info.server_name);
|
||||
str_validate(item->info.server_revision);
|
||||
str_validate(item->info.map_name);
|
||||
if (item->info.server_lang >= NETWORK_NUM_LANGUAGES) item->info.server_lang = 0;
|
||||
if (item->info.map_set >= NUM_LANDSCAPE ) item->info.map_set = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user