diff options
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/algcheck.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/FICS/algcheck.c b/FICS/algcheck.c index 2fc2451..4e3d18d 100644 --- a/FICS/algcheck.c +++ b/FICS/algcheck.c @@ -269,6 +269,11 @@ alg_parse_move(char *mstr, game_state_t *gs, move_t *mt) } else { tmpr = r - 1; } + if (tmpr < 0 || tmpr >= 8) { + warnx("%s: out-of-bounds array read/write: " + "tmpr=%d", __func__, tmpr); + return MOVE_AMBIGUOUS; + } if (gs->board[tf][tmpr] == NOPIECE) { if ((gs->ep_possible[((gs->onMove == WHITE) ? |