From owner-cvs-all Thu Jun 6 18:12:12 2002 Delivered-To: cvs-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 0F5D737B400; Thu, 6 Jun 2002 18:11:58 -0700 (PDT) Date: Thu, 6 Jun 2002 18:11:58 -0700 From: "J. Mallett" To: Bruce Evans Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/ps fmt.c Message-ID: <20020606181157.A8093@FreeBSD.ORG> References: <200206062029.g56KTej24391@freefall.freebsd.org> <20020607101000.R13287-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020607101000.R13287-100000@gamplex.bde.org>; from bde@zeta.org.au on Fri, Jun 07, 2002 at 10:34:30AM +1000 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , X-Affiliated-Projects: FreeBSD, xMach, ircd-hybrid-7 X-Towel: Yes Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * From Bruce Evans > On Thu, 6 Jun 2002, J. Mallett wrote: > > > jmallett 2002/06/06 13:29:40 PDT > > > > Modified files: > > bin/ps fmt.c > > Log: > > Cast arg_max to size_t when comparing it (times 4, plus 1) against SIZE_MAX. I > > was worried about truncation of arg_max by this cast, but if it gets truncated, > > we know it'll obviously be greater than SIZE_MAX anyway. > > This turns a correct bounds check into a broken one just to fix a warning. > arg_max (times 4, plus 1) has already been checked to be a postitive long. > Converting it to a size_t may truncate it to a very small value that is > less than SIZE_MAX, resulting in the bounds check bogusly succeeding. > Example of sizes where this may happen: You're right, ugh. I'm backing it out. -- J. Mallett FreeBSD: The Power To Serve "I've coined new words, like, misunderstanding and Hispanically." -- George W. Bush, Radio-Television Correspondents Association dinner, Washington, D.C., March 29, 2001 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message