Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 1999 00:47:02 -0700
From:      Warner Losh <imp@village.org>
To:        obrien@FreeBSD.ORG
Cc:        Kris Kennaway <kris@hub.freebsd.org>, current@FreeBSD.ORG
Subject:   Re: Overflow in banner(1) 
Message-ID:  <199911240747.AAA18880@harmony.village.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>  <Pine.BSF.4.21.9911232111470.75155-100000@hub.freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




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