From owner-freebsd-current Tue Nov 23 23:48:12 1999 Delivered-To: freebsd-current@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 8079F1510E; Tue, 23 Nov 1999 23:48:06 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id AAA12021; Wed, 24 Nov 1999 00:46:42 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id AAA18880; Wed, 24 Nov 1999 00:47:02 -0700 (MST) Message-Id: <199911240747.AAA18880@harmony.village.org> To: obrien@FreeBSD.ORG Subject: Re: Overflow in banner(1) Cc: Kris Kennaway , current@FreeBSD.ORG In-reply-to: Your message of "Tue, 23 Nov 1999 22:44:25 PST." <19991123224424.B51939@dragon.nuxi.com> References: <19991123224424.B51939@dragon.nuxi.com> Date: Wed, 24 Nov 1999 00:47:02 -0700 From: Warner Losh Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <19991123224424.B51939@dragon.nuxi.com> "David O'Brien" writes: : On Tue, Nov 23, 1999 at 09:15:35PM -0800, Kris Kennaway wrote: : > - (void)fgets(message, sizeof(message), stdin); : > + (void)fgets(message, MAXMSG, stdin); : : There is nothing wrong with the original line here. Please don't change : things that are fine just to change them. We don't want to ofuscate the fix. In fact, the original line is safer than the replaced line. It is safer because message's size might change form MAXMSG to MAXBUF or 24. If you hardwire MAXMSG like this, painful experience has shown that you will get burned. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message