gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] array bound violation in 3.3.4


From: Teun Burgers
Subject: [gnugo-devel] array bound violation in 3.3.4
Date: Thu, 20 Jun 2002 12:11:10 +0200

3.3.4 gives an array bound violation in filllib test 26:

  2566  remove_top_move(int move)
  2567  {
  2568    int k;
  2569    for (k = 0; k < 10; k++) {
  2570      if (best_moves[k] == move) {
  2571        int l;
  2572        for (l = k; l < 10; l++) {
>*2573          best_moves[l] = best_moves[l+1];
  2574          best_move_values[l] = best_move_values[l+1];
  2575        }
  2576        best_moves[9] = NO_MOVE;
  2577        best_move_values[9] = 0.0;
  2578      }
  2579    }
  2580  }

Clearly for l=9, l+1=10 leads to an arraybound violation.
btw it would be better if we introduced a #define BEST_MOVES_SIZE 10
or similar here.

Teun

-- 
Drs A.R. Burgers        Energy research Centre of the Netherlands
Phone: +31-224-564959   P.O. Box 1
Fax  : +31-224-568214   NL-1755 ZG Petten
email: address@hidden   The Netherlands



reply via email to

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