From 27ad2c2fd3659574b7e7e44ba061b9daba4bf320 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 14 Apr 2012 15:43:30 +0200 Subject: [PATCH] Fix crash due to empty PV Reception of a stat01 command before the first PV could cause a crash, as apparently the parser cannot handle this. --- engineoutput.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/engineoutput.c b/engineoutput.c index 94f2a87..157cabf 100644 --- a/engineoutput.c +++ b/engineoutput.c @@ -238,7 +238,7 @@ SetProgramStats (FrontEndProgramStats * stats) // now directly called by back-en } } - if(ParseOneMove(ed.pv, currentMove, &moveType, &ff, &rf, &ft, &rt, &pc)) + if(ed.pv && ed.pv[0] && ParseOneMove(ed.pv, currentMove, &moveType, &ff, &rf, &ft, &rt, &pc)) ed.moveKey = (ff<<24 | rf << 16 | ft << 8 | rt) ^ pc*87161; else ed.moveKey = ed.nodes; // kludge to get unique key unlikely to match any move -- 1.7.0.4