Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Apr 2002 07:10:05 -0700 (PDT)
From:      Peter Pentchev <roam@ringlet.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/36992: battlestar segfaults
Message-ID:  <200204111410.g3BEA5M50971@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/36992; it has been noted by GNATS.

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

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204111410.g3BEA5M50971>