Date: 07 Oct 2001 19:51:48 +0200 From: Dag-Erling Smorgrav <des@ofug.org> To: Mike Barcroft <mike@FreeBSD.ORG> Cc: "Andrey A. Chernov" <ache@nagual.pp.ru>, Peter Pentchev <roam@ringlet.net>, freebsd-net@FreeBSD.ORG, freebsd-audit@FreeBSD.ORG Subject: Re: [CFR] whois(1) out-of-bound access patch Message-ID: <xzp1ykfe3t7.fsf@flood.ping.uio.no> In-Reply-To: <20011007133716.C37270@coffee.q9media.com> References: <20011004121640.C1959@ringworld.oblivion.bg> <20011004132801.A64960@nagual.pp.ru> <20011007133716.C37270@coffee.q9media.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Mike Barcroft <mike@FreeBSD.ORG> writes:
> Andrey A. Chernov <ache@nagual.pp.ru> writes:
> > On Thu, Oct 04, 2001 at 12:16:40 +0300, Peter Pentchev wrote:
> > > + if ((len == 0) || !isspace(buf[len - 1])) {
> > Must be isspace((unsigned char)....)
> Why and where can I find documentation about this?
If buf[len - 1] is a char (which is signed), non-ASCII characters will
be sign-extended unless you cast to unsigned char. It so happens that
it doesn't make any difference for isspace() because in the character
sets we use, no space characters have the high bit set, but strictly
speaking you still need the cast.
DES
--
Dag-Erling Smorgrav - des@ofug.org
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzp1ykfe3t7.fsf>
