From owner-freebsd-audit Sun Oct 7 10:51:58 2001 Delivered-To: freebsd-audit@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 4E23A37B407; Sun, 7 Oct 2001 10:51:52 -0700 (PDT) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id TAA01668; Sun, 7 Oct 2001 19:51:50 +0200 (CEST) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Mike Barcroft Cc: "Andrey A. Chernov" , Peter Pentchev , freebsd-net@FreeBSD.ORG, freebsd-audit@FreeBSD.ORG Subject: Re: [CFR] whois(1) out-of-bound access patch References: <20011004121640.C1959@ringworld.oblivion.bg> <20011004132801.A64960@nagual.pp.ru> <20011007133716.C37270@coffee.q9media.com> From: Dag-Erling Smorgrav Date: 07 Oct 2001 19:51:48 +0200 In-Reply-To: <20011007133716.C37270@coffee.q9media.com> Message-ID: Lines: 16 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mike Barcroft writes: > Andrey A. Chernov 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