[bsd-games] Keep array index in bounds to fix segmentation fault in adventure initialization. (BZ #997933)

Jeff Makey jmakey at fedoraproject.org
Tue Aug 27 15:21:15 UTC 2013


commit c8072f248f17ee3bcd59deff0c8ce69441641394
Author: Jeff Makey <jeff at makey.net>
Date:   Tue Aug 27 08:13:48 2013 -0700

    Keep array index in bounds to fix segmentation fault in adventure initialization.
    (BZ #997933)

 bsd-games-2.17-adventureinit.patch |   11 +++++++++++
 bsd-games.spec                     |    7 ++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/bsd-games-2.17-adventureinit.patch b/bsd-games-2.17-adventureinit.patch
new file mode 100644
index 0000000..3ea99fa
--- /dev/null
+++ b/bsd-games-2.17-adventureinit.patch
@@ -0,0 +1,11 @@
+--- adventure/init.c.orig	2003-12-16 18:47:37.000000000 -0800
++++ adventure/init.c	2013-08-27 08:07:28.627090951 -0700
+@@ -154,7 +154,7 @@
+ 	int     i, j;
+ 
+ 	/* array linkages */
+-	for (i = 1; i <= LOCSIZ; i++)
++	for (i = 1; i < LOCSIZ; i++)
+ 		if (ltext[i].seekadr != 0 && travel[i] != 0)
+ 			if ((travel[i]->tverb) == 1)
+ 				cond[i] = 2;
diff --git a/bsd-games.spec b/bsd-games.spec
index d391003..a2ce049 100644
--- a/bsd-games.spec
+++ b/bsd-games.spec
@@ -4,7 +4,7 @@
 Summary: Collection of text-based games
 Name: bsd-games
 Version: 2.17
-Release: 41%{?dist}
+Release: 42%{?dist}
 License: BSD and BSD with advertising
 Group: Amusements/Games
 URL: ftp://metalab.unc.edu/pub/Linux/games/
@@ -36,6 +36,7 @@ Patch15: bsd-games-2.17-wtfupdate.patch
 Patch16: bsd-games-2.17-backgammonsize.patch
 Patch17: bsd-games-2.17-adventurecrc.patch
 Patch18: bsd-games-2.17-wtfrpm.patch
+Patch19: bsd-games-2.17-adventureinit.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: ncurses-devel words flex flex-static bison
 Requires(pre): shadow-utils
@@ -69,6 +70,7 @@ install -p -m 755 %{SOURCE1} .
 %patch16 -p0 -b .backgammonsize
 %patch17 -p0 -b .adventurecrc
 %patch18 -p1 -b .wtfrpm
+%patch19 -p0 -b .adventureinit
 
 %build
 # We include a templatized configuration settings file to set
@@ -194,6 +196,9 @@ exit 0
 %doc AUTHORS COPYING ChangeLog ChangeLog.0 THANKS YEAR2000 README.hunt trek/USD.doc/trek.me
 
 %changelog
+* Tue Aug 27 2013 Jeff Makey <jeff at makey.net> - 2.17-42
+- Fix segmentation fault in adventure initialization. (BZ #997933)
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.17-41
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list