mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-06 19:27:16 +01:00
(svn r26051) -Fix: out of bounds access in CmdTownCargoGoal
This commit is contained in:
parent
6f21593bf6
commit
8e27031492
@ -2465,7 +2465,7 @@ CommandCost CmdTownCargoGoal(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
|||||||
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
if (_current_company != OWNER_DEITY) return CMD_ERROR;
|
||||||
|
|
||||||
TownEffect te = (TownEffect)GB(p1, 16, 8);
|
TownEffect te = (TownEffect)GB(p1, 16, 8);
|
||||||
if (te < TE_BEGIN || te > TE_END) return CMD_ERROR;
|
if (te < TE_BEGIN || te >= TE_END) return CMD_ERROR;
|
||||||
|
|
||||||
uint16 index = GB(p1, 0, 16);
|
uint16 index = GB(p1, 0, 16);
|
||||||
Town *t = Town::GetIfValid(index);
|
Town *t = Town::GetIfValid(index);
|
||||||
|
Loading…
Reference in New Issue
Block a user