From owner-freebsd-bugs Thu Apr 11 7:10:15 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1F58137B400 for ; Thu, 11 Apr 2002 07:10:05 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3BEA5M50971; Thu, 11 Apr 2002 07:10:05 -0700 (PDT) (envelope-from gnats) Date: Thu, 11 Apr 2002 07:10:05 -0700 (PDT) Message-Id: <200204111410.g3BEA5M50971@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Peter Pentchev Subject: Re: bin/36992: battlestar segfaults Reply-To: Peter Pentchev Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/36992; it has been noted by GNATS. From: Peter Pentchev To: Ceri Davies 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