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:
Adam Weinberger 2014-12-12 15:15:34 +00:00
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

View file

@ -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

View 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;