* Patch from pmaydell@chiark.greenend.org.uk to fix a segfault in

battlestar if you say "wear knfo" or similar nonsensical things.
     (Patch also sent upstream.) Closes: #70465


git-svn-id: file:///srv/svn/joey/bsdgames-trunk@5128 a4a2c43b-8ac3-0310-8836-e0e880c912e2
This commit is contained in:
joey
2000-08-29 00:23:15 +00:00
parent 8fc65f19a3
commit ef972d8e76
3 changed files with 22 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: com2.c,v 1.7 1998/08/24 00:22:45 hubertf Exp $ */
/* $NetBSD: com2.c,v 1.8 1999/07/14 17:42:13 hubertf Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: com2.c,v 1.7 1998/08/24 00:22:45 hubertf Exp $");
__RCSID("$NetBSD: com2.c,v 1.8 1999/07/14 17:42:13 hubertf Exp $");
#endif
#endif /* not lint */
@@ -54,12 +54,18 @@ wearit()
while (wordtype[++wordnumber] == ADJS);
while (wordnumber <= wordcount) {
value = wordvalue[wordnumber];
for (n = 0; objsht[value][n]; n++);
switch (value) {
case -1:
/* Is the thing being worn a known object? */
if (value == -1) {
puts("Wear what?");
return (firstnumber);
}
/* Now find the length of the short description,
* mostly so we know if it ends in 's' or not.
*/
for (n = 0; objsht[value][n]; n++)
/* do nothing */;
switch (value) {
default:
printf("You can't wear%s%s!\n", (objsht[value][n - 1] == 's' ? " " : " a "), objsht[value]);
@@ -301,7 +307,7 @@ int
follow()
{
if (followfight == ourtime) {
puts("The Dark Lord leaps away and runs down secret tunnels and corridoors.");
puts("The Dark Lord leaps away and runs down secret tunnels and corridors.");
puts("You chase him through the darkness and splash in pools of water.");
puts("You have cornered him. His laser sword extends as he steps forward.");
position = FINAL;

8
debian/changelog vendored
View File

@@ -1,3 +1,11 @@
bsdgames (2.11-2) unstable; urgency=low
* Patch from pmaydell@chiark.greenend.org.uk to fix a segfault in
battlestar if you say "wear knfo" or similar nonsensical things.
(Patch also sent upstream.) Closes: #70465
-- Joey Hess <joeyh@debian.org> Mon, 28 Aug 2000 17:16:27 -0700
bsdgames (2.11-1) unstable; urgency=low
* New upstream.

2
debian/control vendored
View File

@@ -3,7 +3,7 @@ Section: games
Priority: optional
Build-Depends: debhelper, libncurses5-dev, flex, bison, wenglish
Maintainer: Joey Hess <joeyh@debian.org>
Standards-Version: 3.1.1.1
Standards-Version: 3.2.1.0
Package: bsdgames
Architecture: any