Skip to content

Commit c15a4e1

Browse files
committed
fix index out of bounds in moves.c
1 parent ff96dc6 commit c15a4e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

moves.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,9 @@ make_move_no_hash( int side_to_move, int move ) {
320320
INLINE void
321321
unmake_move( int side_to_move, int move ) {
322322
board[move] = EMPTY;
323-
323+
if (disks_played < 1 || disks_played > MAX_SEARCH_DEPTH) {
324+
return;
325+
}
324326
disks_played--;
325327

326328
hash1 = hash_stored1[disks_played];

0 commit comments

Comments
 (0)