diff options
author | Darkvater <darkvater@openttd.org> | 2006-10-31 21:15:56 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-10-31 21:15:56 +0000 |
commit | eadf788cc5d068622f20221566f4027625090689 (patch) | |
tree | f1aae895580a4a2bc7864f645fae39e9c2bc7669 /vehicle_gui.c | |
parent | 993cb13c8dde55d77b732bba55bf3c94b0ea9216 (diff) | |
download | openttd-eadf788cc5d068622f20221566f4027625090689.tar.xz |
(svn r7022) -Fix [FS#292]: Properly guard against viewing company-sensitive information from
invalid players (eg spectators) which could lead to crashes.
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r-- | vehicle_gui.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c index df33fd69c..2eaad2ee0 100644 --- a/vehicle_gui.c +++ b/vehicle_gui.c @@ -1856,8 +1856,11 @@ static const WindowDesc _player_vehicle_list_aircraft_desc = { static void ShowVehicleListWindowLocal(PlayerID player, byte vehicle_type, StationID station, OrderID order, uint16 depot_airport_index) { Window *w; - WindowNumber num = (vehicle_type << 11) | player; + WindowNumber num; + if (!IsValidPlayer(player)) return; + + num = (vehicle_type << 11) | player; if (order != INVALID_ORDER) { num |= (order << 16) | VLW_SHARED_ORDERS; } else if (depot_airport_index != INVALID_STATION) { |