Bug 195837 - [bugfix] Port games/bsdgames trek has a boundary condition bug
Summary: [bugfix] Port games/bsdgames trek has a boundary condition bug
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Adam Weinberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-09 23:59 UTC by Kenji Rikitake
Modified: 2014-12-12 15:16 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (adamw)


Attachments
patch for computer.c (487 bytes, patch)
2014-12-09 23:59 UTC, Kenji Rikitake
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenji Rikitake 2014-12-09 23:59:38 UTC
Created attachment 150416 [details]
patch for computer.c

computer.c in bsdgames trek has a bug. Patch attached to fix this. Note: this is the upstream (Dragonfly) bug (not reported yet to Dragonfly).

See also https://github.com/jj1bdx/bsdtrek/commit/da9b15595e3bf52d6c5326f9d56dc3ad96d5e5fb
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-12-09 23:59:38 UTC
Auto-assigned to maintainer adamw@FreeBSD.org
Comment 2 Adam Weinberger freebsd_committer freebsd_triage 2014-12-10 00:09:49 UTC
What is the bug?
Comment 3 Kenji Rikitake 2014-12-10 00:48:49 UTC
(In reply to Adam Weinberger from comment #2)
> What is the bug?

Without the change the program will accept out-of-range quadrant numbers.
In trek.h, the values of the macros are defined as NQUADS = 8 and NSECTS = 10.
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-12-12 15:15:52 UTC
A commit references this bug:

Author: adamw
Date: Fri Dec 12 15:15:35 UTC 2014
New revision: 374594
URL: https://svnweb.freebsd.org/changeset/ports/374594

Log:
  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

Changes:
  head/games/bsdgames/Makefile
  head/games/bsdgames/files/patch-trek_computer.c
Comment 5 Adam Weinberger freebsd_committer freebsd_triage 2014-12-12 15:16:05 UTC
Committed. Thanks for your all work here, Kenji!