From 25a2de7c48d693f8dd3ecc8dd9b794b140f2bdaf Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 19 Apr 2012 10:48:41 +0200 Subject: [PATCH] Fix crash on time forfeit with -st option When fixed time per move was set from the command line, the time-control strings were not set. This let to a crash when an engine forfeited. The GetTimeQuota function is now made resistant to a NULL pointer here. --- backend.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/backend.c b/backend.c index af2b247..634b710 100644 --- a/backend.c +++ b/backend.c @@ -1252,7 +1252,7 @@ GetTimeQuota (int movenr, int lastUsed, char *tcString) long time, increment; char *s = tcString; - if(!*s) return 0; // empty TC string means we ran out of the last sudden-death version + if(!s || !*s) return 0; // empty TC string means we ran out of the last sudden-death version do { if(moves) NextSessionFromString(&s, &moves, &time, &increment, &incType); nextSession = s; suddenDeath = moves == 0 && increment == 0; -- 1.7.0.4