diff options
author | Darkvater <Darkvater@openttd.org> | 2006-01-26 18:45:04 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2006-01-26 18:45:04 +0000 |
commit | 5e7526948a4cc7a2a2f100fa0e783de17e1335ba (patch) | |
tree | 1bd0b35c99dd56e0451da08bc107dd46cc07328f /tree_cmd.c | |
parent | 7d17583a29878b4e911b769f473be11050c1e61b (diff) | |
download | openttd-5e7526948a4cc7a2a2f100fa0e783de17e1335ba.tar.xz |
(svn r3446) - Fix: incorrect validating of tree-planting command which can allow a buffer-overflow (Tron)
Diffstat (limited to 'tree_cmd.c')
-rw-r--r-- | tree_cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tree_cmd.c b/tree_cmd.c index ed207f4c7..51a5cfe06 100644 --- a/tree_cmd.c +++ b/tree_cmd.c @@ -139,7 +139,7 @@ int32 CmdPlantTree(int ex, int ey, uint32 flags, uint32 p1, uint32 p2) int32 cost; int sx, sy, x, y; - if (p2 > MapSize()) return CMD_ERROR; + if (p2 >= MapSize()) return CMD_ERROR; /* Check the tree type. It can be random or some valid value within the current climate */ if (p1 != (uint)-1 && p1 - _tree_base_by_landscape[_opt.landscape] >= _tree_count_by_landscape[_opt.landscape]) return CMD_ERROR; |