From: Marco Costalba Date: Mon, 25 Jan 2010 21:18:12 +0000 (+0100) Subject: Fix a possible crash in thread_is_available() X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=5ca428402793b07b432b006056a1368f359c4ea0;hp=5ca428402793b07b432b006056a1368f359c4ea0 Fix a possible crash in thread_is_available() When we have more then 2 threads then we do an array access with index 'Threads[slave].activeSplitPoints - 1' This should be >= 0 because we tested the variable just few statements before, but because is a shared variable it could be that the 'slave' thread set the value to zero just after we test it, so that when we use the decremented variable for array access we crash. Bug spotted by Bruno Causse. Signed-off-by: Marco Costalba ---