From owner-freebsd-current Tue Nov 23 23:59:35 1999 Delivered-To: freebsd-current@freebsd.org Received: from zibbi.mikom.csir.co.za (zibbi.mikom.csir.co.za [146.64.24.58]) by hub.freebsd.org (Postfix) with ESMTP id 80B5415029; Tue, 23 Nov 1999 23:59:21 -0800 (PST) (envelope-from jhay@zibbi.mikom.csir.co.za) Received: (from jhay@localhost) by zibbi.mikom.csir.co.za (8.9.3/8.9.3) id JAA96963; Wed, 24 Nov 1999 09:58:51 +0200 (SAT) (envelope-from jhay) From: John Hay Message-Id: <199911240758.JAA96963@zibbi.mikom.csir.co.za> Subject: Re: Overflow in banner(1) In-Reply-To: <199911240747.AAA18880@harmony.village.org> from Warner Losh at "Nov 24, 1999 00:47:02 am" To: imp@village.org (Warner Losh) Date: Wed, 24 Nov 1999 09:58:51 +0200 (SAT) Cc: obrien@FreeBSD.ORG, kris@hub.FreeBSD.ORG (Kris Kennaway), current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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. Well the original line is plain wrong if Brian's patch is being used, because there message is a pointer and the size of a pointer is 4. John -- John Hay -- John.Hay@mikom.csir.co.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message