Fix overflow risk in split point
authorJoona Kiiski <joona.kiiski@gmail.com>
Thu, 10 Dec 2009 14:21:06 +0000 (16:21 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 10 Dec 2009 18:00:19 +0000 (19:00 +0100)
Sizeof of search stack should be PLY_MAX+2 instead of PLY_MAX.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/thread.h

index 5c169ee9b3283ec0375526e306df43606bcfeb18..fd28ddf7d390717d51782792f3baf9d5361f34b4 100644 (file)
@@ -46,7 +46,7 @@ const int THREAD_MAX = 8;
 struct SplitPoint {
   SplitPoint *parent;
   Position pos;
-  SearchStack sstack[THREAD_MAX][PLY_MAX];
+  SearchStack sstack[THREAD_MAX][PLY_MAX_PLUS_2];
   SearchStack *parentSstack;
   int ply;
   Depth depth;