fix out of bounds access.
thx tdeval@ for mmap malloc. okay naddy@
This commit is contained in:
parent
295bf31885
commit
eb2052e928
12
games/gnushogi/patches/patch-src_init_c
Normal file
12
games/gnushogi/patches/patch-src_init_c
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-src_init_c,v 1.1 2004/08/16 14:58:48 espie Exp $
|
||||
--- src/init.c.orig Fri May 19 10:44:14 1995
|
||||
+++ src/init.c Mon Aug 16 16:15:46 2004
|
||||
@@ -225,7 +225,7 @@ short distance (short a, short b)
|
||||
#else
|
||||
short distance (short a, short b)
|
||||
{
|
||||
- return (use_distdata ? (short)(*distdata)[(int)a][(int)b] : (short)computed_distance(a,b));
|
||||
+ return (use_distdata && a < NO_SQUARES && b < NO_SQUARES ? (short)(*distdata)[(int)a][(int)b] : (short)computed_distance(a,b));
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user