From owner-freebsd-security Fri Apr 6 22:29:38 2001 Delivered-To: freebsd-security@freebsd.org Received: from ldc.ro (ldc-gw.pub.ro [192.129.3.227]) by hub.freebsd.org (Postfix) with SMTP id 1036A37B43C for ; Fri, 6 Apr 2001 22:29:30 -0700 (PDT) (envelope-from razor@ldc.ro) Received: (qmail 8225 invoked by uid 666); 7 Apr 2001 05:29:13 -0000 Date: Sat, 7 Apr 2001 08:29:13 +0300 From: Alex Popa To: Garrett Wollman Cc: Brian Somers , security@FreeBSD.ORG Subject: Re: ntpd patch Message-ID: <20010407082913.A8159@ldc.ro> References: <20010406035459.A6350@nagual.pp.ru> <200104060033.f360XfP03505@hak.lan.Awfulhak.org> <200104060038.UAA73318@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200104060038.UAA73318@khavrinen.lcs.mit.edu>; from wollman@khavrinen.lcs.mit.edu on Thu, Apr 05, 2001 at 08:38:02PM -0400 Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Thu, Apr 05, 2001 at 08:38:02PM -0400, Garrett Wollman wrote: > < said: > > > I believe the int is correct. > > You are mistaken. The purpose of the cast is to defeat the automatic > promotion from `char' to `int', which causes sign-extension if `char' > is signed. Casting to `unsigned char' prevents this from happening. AFAIK, the casts are applied *after* the default promtions. The only solution to defeating sign extension is to *declare* unsigned char. > > -GAWollman > ------------+------------------------------------------ Alex Popa, | "Artificial Intelligence is razor@ldc.ro| no match for Natural Stupidity" ------------+------------------------------------------ "It took the computing power of three C-64s to fly to the Moon. It takes a 486 to run Windows 95. Something is wrong here." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message