From: H.G.Muller Date: Wed, 20 Jan 2016 20:30:51 +0000 (+0100) Subject: Fix crash on pasting garbage FEN X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=ccdd18ed4c9ca090ead3c1ac844b621fdaa51984 Fix crash on pasting garbage FEN The auto-size patch had made XBoard crash-prone on pasting pure garbage with Paste Position, because this would set the number of files or ranks to values <= 0. Which would cause a floating pont exception during drawing of the board in XBoard. --- diff --git a/backend.c b/backend.c index 174b2a2..d362be5 100644 --- a/backend.c +++ b/backend.c @@ -18148,7 +18148,7 @@ ParseFEN (Board board, int *blackPlaysFirst, char *fen, Boolean autoSize) while (emptycount--) board[i][(j++)+gameInfo.holdingsWidth] = EmptySquare; if (*p == '/') p++; - else if(autoSize) { // we stumbled unexpectedly into end of board + else if(autoSize && i != BOARD_HEIGHT-1) { // we stumbled unexpectedly into end of board for(k=i; k