From setantae@submonkey.net  Thu Apr 11 05:15:03 2002
Return-Path: <setantae@submonkey.net>
Received: from rhadamanth.submonkey.net (pc4-card4-0-cust162.cdf.cable.ntl.com [80.4.14.162])
	by hub.freebsd.org (Postfix) with ESMTP id 9A90937B400
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Apr 2002 05:15:02 -0700 (PDT)
Received: from setantae by rhadamanth.submonkey.net with local (Exim 3.35 #1)
	id 16vdTh-000JUw-00
	for FreeBSD-gnats-submit@freebsd.org; Thu, 11 Apr 2002 13:15:01 +0100
Message-Id: <E16vdTh-000JUw-00@rhadamanth.submonkey.net>
Date: Thu, 11 Apr 2002 13:15:01 +0100
From: Ceri Davies <ceri@FreeBSD.org>
Sender: Ceri Davies <setantae@submonkey.net>
Reply-To: Ceri Davies <ceri@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: battlestar segfaults
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         36992
>Category:       bin
>Synopsis:       battlestar segfaults
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 11 05:20:01 PDT 2002
>Closed-Date:    Wed May 01 02:19:16 PDT 2002
>Last-Modified:  Wed May 01 02:19:16 PDT 2002
>Originator:     Ceri Davies
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD rhadamanth.private.submonkey.net 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Apr 10 12:48:34 BST 2002 setantae@rhadamanth.private.submonkey.net:/usr/obj/usr/src/sys/RHADAMANTH i386


	
>Description:

/usr/games/battlestar segfaults if you misspell or omit nouns.


>How-To-Repeat:
	

{setantae@rhadamanth}-{~} $ battlestar
/var/games/battlestar.log: Permission denied
Version 4.2, fall 1984.
First Adventure game written by His Lordship, the honorable
Admiral D.W. Riggle


        This is a luxurious stateroom.
The floor is carpeted with a soft animal fur and the great wooden furniture
is inlaid with strips of platinum and gold.  Electronic equipment built
into the walls and ceiling is flashing wildly.  The floor shudders and
the sounds of dull explosions rumble though the room.  From a window in
the wall ahead comes a view of darkest space.  There is a small adjoining
room behind you, and a doorway right.

>Fix:

No idea



>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@ringlet.net>
To: Ceri Davies <ceri@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/36992: battlestar segfaults
Date: Thu, 11 Apr 2002 17:01:27 +0300

 On Thu, Apr 11, 2002 at 01:15:01PM +0100, Ceri Davies wrote:
 > 
 > >Number:         36992
 > >Category:       bin
 > >Synopsis:       battlestar segfaults
 > >Originator:     Ceri Davies
 > 	
 > >Description:
 > 
 > /usr/games/battlestar segfaults if you misspell or omit nouns.
 
 A quick workaround for this specific problem ('wear' without arguments
 or with an invalid object name as an argument) would be the attached
 patch.  However, IMHO the battlestar source needs some more auditing..
 
 G'luck,
 Peter
 
 -- 
 Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
 PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 This sentence no verb.
 
 Index: src/games/battlestar/com2.c
 ===================================================================
 RCS file: /home/ncvs/src/games/battlestar/com2.c,v
 retrieving revision 1.9
 diff -u -r1.9 com2.c
 --- src/games/battlestar/com2.c	8 Oct 2000 03:24:29 -0000	1.9
 +++ src/games/battlestar/com2.c	11 Apr 2002 13:59:41 -0000
 @@ -51,13 +51,12 @@
  	while(wordtype[++wordnumber] == ADJS);
  	while(wordnumber <= wordcount){
  		value = wordvalue[wordnumber];
 +		if (value == -1) {
 +			puts("Wear what?");
 +			return (firstnumber);
 +		}
  		for (n=0; objsht[value][n]; n++);
  		switch(value){
 -
 -			case -1:
 -				puts("Wear what?");
 -				return(firstnumber);
 -
  			default:
  				printf("You can't wear%s%s!\n",(objsht[value][n-1] == 's' ? " " : " a "),objsht[value]);
  				return(firstnumber);

From: Ceri Davies <setantae@submonkey.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: [setantae@submonkey.net: Re: bin/36992: battlestar segfaults]
Date: Thu, 11 Apr 2002 20:59:27 +0100

 --ZPt4rx8FFjLCG7dd
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 
 Adding to audit trail (like I should have done the first time..)
 
 Ceri
 
 -- 
 get the cool shoe shine
 
 --ZPt4rx8FFjLCG7dd
 Content-Type: message/rfc822
 Content-Disposition: inline
 
 Return-path: <owner-freebsd-bugs@FreeBSD.ORG>
 Envelope-to: setantae@submonkey.net
 Delivery-date: Thu, 11 Apr 2002 20:58:28 +0100
 Received: from shaft.techsupport.co.uk ([212.250.77.214])
 	by rhadamanth.submonkey.net with esmtp (Exim 3.35 #1)
 	id 16vkiB-000BlZ-00
 	for setantae@submonkey.net; Thu, 11 Apr 2002 20:58:28 +0100
 Received: from mx2.freebsd.org ([216.136.204.119])
 	by shaft.techsupport.co.uk with esmtp (Exim 3.35 #1)
 	id 16vkiB-000IZa-00
 	for setantae@submonkey.net; Thu, 11 Apr 2002 20:58:27 +0100
 Received: from hub.freebsd.org (hub.FreeBSD.org [216.136.204.18])
 	by mx2.freebsd.org (Postfix) with ESMTP
 	id 5440855A1C; Thu, 11 Apr 2002 12:58:22 -0700 (PDT)
 	(envelope-from owner-freebsd-bugs@FreeBSD.ORG)
 Received: by hub.freebsd.org (Postfix, from userid 538)
 	id EFE2037B405; Thu, 11 Apr 2002 12:58:20 -0700 (PDT)
 Received: from localhost (localhost [127.0.0.1])
 	by hub.freebsd.org (Postfix) with SMTP
 	id DF2202E8001; Thu, 11 Apr 2002 12:58:20 -0700 (PDT)
 Received: by hub.freebsd.org (bulk_mailer v1.12); Thu, 11 Apr 2002 12:58:20 -0700
 Delivered-To: freebsd-bugs@freebsd.org
 Received: from rhadamanth.submonkey.net (pc4-card4-0-cust162.cdf.cable.ntl.com [80.4.14.162])
 	by hub.freebsd.org (Postfix) with ESMTP id D99C537B400
 	for <freebsd-bugs@freebsd.org>; Thu, 11 Apr 2002 12:58:18 -0700 (PDT)
 Received: from setantae by rhadamanth.submonkey.net with local (Exim 3.35 #1)
 	id 16vkhm-000BlE-00; Thu, 11 Apr 2002 20:58:02 +0100
 Date: Thu, 11 Apr 2002 20:58:02 +0100
 From: Ceri Davies <setantae@submonkey.net>
 To: Peter Pentchev <roam@ringlet.net>
 Cc: freebsd-bugs@FreeBSD.org
 Subject: Re: bin/36992: battlestar segfaults
 Message-ID: <20020411195802.GA45051@submonkey.net>
 References: <200204111410.g3BEA5M50971@freefall.freebsd.org>
 Mime-Version: 1.0
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 In-Reply-To: <200204111410.g3BEA5M50971@freefall.freebsd.org>
 User-Agent: Mutt/1.3.28i
 Sender: owner-freebsd-bugs@FreeBSD.ORG
 List-ID: <freebsd-bugs.FreeBSD.ORG>
 List-Archive: <http://docs.freebsd.org/mail/> (Web Archive)
 List-Help: <mailto:majordomo@FreeBSD.ORG?subject=help> (List Instructions)
 List-Subscribe: <mailto:majordomo@FreeBSD.ORG?subject=subscribe%20freebsd-bugs>
 List-Unsubscribe: <mailto:majordomo@FreeBSD.ORG?subject=unsubscribe%20freebsd-bugs>
 X-Loop: FreeBSD.org
 Precedence: bulk
 
 On Thu, Apr 11, 2002 at 07:10:05AM -0700, Peter Pentchev wrote:
 >  
 >  A quick workaround for this specific problem ('wear' without arguments
 >  or with an invalid object name as an argument) would be the attached
 >  patch.  However, IMHO the battlestar source needs some more auditing..
 
 Just to confirm the patch does fix the problem.
 
 Thanks,
 
 Ceri
 
 -- 
 get the cool shoe shine
 
 To Unsubscribe: send mail to majordomo@FreeBSD.org
 with "unsubscribe freebsd-bugs" in the body of the message
 
 --ZPt4rx8FFjLCG7dd--
State-Changed-From-To: open->patched 
State-Changed-By: roam 
State-Changed-When: Mon Apr 15 10:27:59 PDT 2002 
State-Changed-Why:  
Committed to -current, MFC in two weeks' time. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36992 
State-Changed-From-To: patched->closed 
State-Changed-By: roam 
State-Changed-When: Wed May 1 02:18:30 PDT 2002 
State-Changed-Why:  
The fix was merged into the RELENG_4 branch. 
Thanks for the bug report! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36992 
>Unformatted:
 >-: wear robe
 You aren't holding the robe.
 >-: wear rob
 Segmentation fault
 {setantae@rhadamanth}-{~} $ battlestar
 /var/games/battlestar.log: Permission denied
 Version 4.2, fall 1984.
 First Adventure game written by His Lordship, the honorable
 Admiral D.W. Riggle
 
 
         This is a luxurious stateroom.
 The floor is carpeted with a soft animal fur and the great wooden furniture
 is inlaid with strips of platinum and gold.  Electronic equipment built
 into the walls and ceiling is flashing wildly.  The floor shudders and
 the sounds of dull explosions rumble though the room.  From a window in
 the wall ahead comes a view of darkest space.  There is a small adjoining
 room behind you, and a doorway right.
 
 >-: wear
 Segmentation fault
 {setantae@rhadamanth}-{~} $ wear rober
 wear: Command not found.
 {setantae@rhadamanth}-{~} $ battlestar
 /var/games/battlestar.log: Permission denied
 Version 4.2, fall 1984.
 First Adventure game written by His Lordship, the honorable
 Admiral D.W. Riggle
 
 
         This is a luxurious stateroom.
 The floor is carpeted with a soft animal fur and the great wooden furniture
 is inlaid with strips of platinum and gold.  Electronic equipment built
 into the walls and ceiling is flashing wildly.  The floor shudders and
 the sounds of dull explosions rumble though the room.  From a window in
 the wall ahead comes a view of darkest space.  There is a small adjoining
 room behind you, and a doorway right.
 
 >-: wear rober
 Segmentation fault
 {setantae@rhadamanth}-{~} $
 
