Fix a bounds-checking typo in trek. The number of sectors was being used
to check input for the quadrant, and NSECTS > NQUADS. PR: 195837 Submitted by: Kenji Rikitake
This commit is contained in:
parent
361a77eacc
commit
f0e043a401
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=374594
2 changed files with 16 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
PORTNAME= bsdgames
|
||||
PORTVERSION= 3.8.2
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= games
|
||||
# Fetched from git://git.dragonflybsd.org/dragonfly.git, v${PORTVERSION}, /games
|
||||
|
|
15
games/bsdgames/files/patch-trek_computer.c
Normal file
15
games/bsdgames/files/patch-trek_computer.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
--- trek/computer.c.orig 2014-12-12 15:10:37 UTC
|
||||
+++ trek/computer.c
|
||||
@@ -175,10 +175,10 @@ computer(int v __unused)
|
||||
tqy = Ship.quady;
|
||||
} else {
|
||||
ix = getintpar("Quadrant");
|
||||
- if (ix < 0 || ix >= NSECTS)
|
||||
+ if (ix < 0 || ix >= NQUADS)
|
||||
break;
|
||||
iy = getintpar("q-y");
|
||||
- if (iy < 0 || iy >= NSECTS)
|
||||
+ if (iy < 0 || iy >= NQUADS)
|
||||
break;
|
||||
tqx = ix;
|
||||
tqy = iy;
|
Loading…
Reference in a new issue