[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] bugs report
From: |
bump |
Subject: |
Re: [gnugo-devel] bugs report |
Date: |
Fri, 11 Jul 2003 11:19:57 -0700 |
Pcibus wrote:
> 2.2 Reading uninitialized memory (sometimes occur)
> engine\optics.c 1811 line.
> int tmp_point = heye[pos].attack_point[r];
> engine\optics.c 1820 line.
> int tmp_point = heye[pos].defense_point[r];
This looks like it might be worth fixing.
Dan
Index: engine/optics.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/optics.c,v
retrieving revision 1.77
diff -u -r1.77 optics.c
--- engine/optics.c 2 Jun 2003 21:26:27 -0000 1.77
+++ engine/optics.c 11 Jul 2003 18:16:05 -0000
@@ -1808,16 +1808,24 @@
for (r = 0; r < 4; r++) {
if (attack_values[r] < attack_value) {
int tmp_value = attack_values[r];
- int tmp_point = heye[pos].attack_point[r];
+ int tmp_point;
+ if (tmp_value)
+ tmp_point = heye[pos].attack_point[r];
+ else
+ tmp_point = 0;
attack_values[r] = attack_value;
heye[pos].attack_point[r] = attack_point;
attack_value = tmp_value;
attack_point = tmp_point;
}
-
+
if (defense_values[r] < defense_value) {
int tmp_value = defense_values[r];
- int tmp_point = heye[pos].defense_point[r];
+ int tmp_point;
+ if (tmp_value)
+ tmp_point = heye[pos].defense_point[r];
+ else
+ tmp_point = 0;
defense_values[r] = defense_value;
heye[pos].defense_point[r] = defense_point;
defense_value = tmp_value;
Re: [gnugo-devel] bugs report,
bump <=