(svn r3446) - Fix: incorrect validating of tree-planting command which can allow a buffer-overflow (Tron)

This commit is contained in:
Darkvater 2006-01-26 18:45:04 +00:00
parent 663b1c6c00
commit 6fb36934a8
1 changed files with 1 additions and 1 deletions

View File

@ -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;