gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnugo-devel] 3.3.12: array bound violation in surround.c


From: Teun Burgers
Subject: [gnugo-devel] 3.3.12: array bound violation in surround.c
Date: Thu, 21 Nov 2002 21:19:31 +0100

Array bounds checking revealed an array bound violation in surround.c
line 265
It is fixed by this patch

- enlarge mn array in surround.c to avoid array bound violation.

Teun

--- surround.c  Tue Nov 19 05:49:27 2002
+++ surround.c.new      Thu Nov 21 13:44:25 2002
@@ -87,7 +87,7 @@
   int other = OTHER_COLOR(color);
   
   char mf[BOARDMAX]; /* friendly dragon  */
-  char mn[BOARDMAX]; /* neighbor dragons */
+  char mn[BOARDSIZE]; /* neighbor dragons */
   
   memset(mf, 0, sizeof(mf));
   memset(mn, 0, sizeof(mn));
an array bound violation in surround.c, line 265

--- surround.c  Tue Nov 19 05:49:27 2002
+++ surround.c.new      Thu Nov 21 13:44:25 2002
@@ -87,7 +87,7 @@
   int other = OTHER_COLOR(color);
   
   char mf[BOARDMAX]; /* friendly dragon  */
-  char mn[BOARDMAX]; /* neighbor dragons */
+  char mn[BOARDSIZE]; /* neighbor dragons */
   
   memset(mf, 0, sizeof(mf));
   memset(mn, 0, sizeof(mn));


reply via email to

[Prev in Thread] Current Thread [Next in Thread]