]> git.sesse.net Git - stockfish/commit
Fix crash in best_group() (#1891)
authornoobpwnftw <noobpwnftw@users.noreply.github.com>
Sat, 22 Dec 2018 17:05:13 +0000 (01:05 +0800)
committerStéphane Nicolet <cassio@free.fr>
Mon, 24 Dec 2018 10:20:14 +0000 (11:20 +0100)
commit0194da0d80f35faba08c86e3a6845bdc1268e4c6
treeca0176602ba38b68c7c75ce5739f56fd7dadcdc9
parentade87ff8d3603c014370d5d6b46ef0b5a5fc157d
Fix crash in best_group() (#1891)

This pull request fixes a rare crashing bug on Windows inside our NUMA code, first
reported by Dann Corbit in the following forum thread (thanks!):
https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/gA6aoMEuOwg

The fix is to not use structure member beyond known size when iterating through
'SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX' structure. We note that the Microsoft
API is guaranteed to provide us at least one element upon successful, and no
element in the structure can have a zero size.

No functional change.
src/misc.cpp