mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 08:37:44 +00:00
5df7d62eb9
If after 'moves' there is a space then we crash. The problem is that operator>>() trims whitespaces so that after 'moves' has been extract we are still not at eof() but remaining string contains only spaces. So that the next extarction operation uip >> token ends up with unchanged token value that remains 'moves', this garbage value is then feeded to RootPosition.do_move() through move_from_string() that does not detect the invalid move value leading to a crash. This bug is triggered by Shredder 12 interface under Mac that puts a space after 'moves' without any actual move list. Bug fixed by Justin Blanchard After reviewing UCI parsing code I spotted other possible weak points due to the fact that we don't test if the last extract operation has been succesful. So I have extended Justing patch to fix the remaining possible holes in uci.cpp No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>