Fix DarkSquare bug in piece counting
authorH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 27 Nov 2015 16:55:13 +0000 (17:55 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 27 Nov 2015 16:55:13 +0000 (17:55 +0100)
When counting pieces for adjudication purposes, a DarkSquare on the
board caused an out-of-bounds access to the counter array.

backend.c

index 95ab011..6ec7be2 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -8109,7 +8109,7 @@ Adjudicate (ChessProgramState *cps)
        // most tests only when we understand the game, i.e. legality-checking on
            if( appData.testLegality )
            {   /* [HGM] Some more adjudications for obstinate engines */
-               int nrW, nrB, bishopColor, staleW, staleB, nr[EmptySquare+1], i;
+               int nrW, nrB, bishopColor, staleW, staleB, nr[EmptySquare+2], i;
                static int moveCount = 6;
                ChessMove result;
                char *reason = NULL;