projects
/
xboard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
19fb94c
)
Fix crash due to empty PV
author
H.G. Muller
<h.g.muller@hccnet.nl>
Sat, 14 Apr 2012 13:43:30 +0000 (15:43 +0200)
committer
H.G. Muller
<h.g.muller@hccnet.nl>
Sat, 14 Apr 2012 13:45:06 +0000 (15:45 +0200)
Reception of a stat01 command before the first PV could cause a crash,
as apparently the parser cannot handle this.
engineoutput.c
patch
|
blob
|
history
diff --git
a/engineoutput.c
b/engineoutput.c
index
94f2a87
..
157cabf
100644
(file)
--- 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