From: H.G. Muller Date: Sat, 14 Apr 2012 13:43:30 +0000 (+0200) Subject: Fix crash due to empty PV X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=27ad2c2fd3659574b7e7e44ba061b9daba4bf320 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. --- 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