From: H.G. Muller Date: Wed, 12 Oct 2011 15:23:57 +0000 (+0200) Subject: Fix crash on loading garbage game file X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=95ca32189a095e0ef60ca6391bc0192695d195dc Fix crash on loading garbage game file XBoard crashed when a game file contained a PGN game result before any valid game start, because data would be written in a game-list node that did not exist yet. This would occur frequently when garage was read; basically any asterisk in the data would do it. --- diff --git a/gamelist.c b/gamelist.c index 2626839..a36af7a 100644 --- a/gamelist.c +++ b/gamelist.c @@ -304,6 +304,7 @@ int GameListBuild(f) case BlackWins: case GameIsDrawn: case GameUnfinished: + if(!currentListGame) break; if (currentListGame->gameInfo.resultDetails != NULL) { free(currentListGame->gameInfo.resultDetails); }