From 95ca32189a095e0ef60ca6391bc0192695d195dc Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 12 Oct 2011 17:23:57 +0200 Subject: [PATCH] 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. --- gamelist.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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); } -- 1.7.0.4