Date: Thu, 6 Jun 2002 18:11:58 -0700 From: "J. Mallett" <jmallett@FreeBSD.org> To: Bruce Evans <bde@zeta.org.au> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/ps fmt.c Message-ID: <20020606181157.A8093@FreeBSD.ORG> In-Reply-To: <20020607101000.R13287-100000@gamplex.bde.org>; from bde@zeta.org.au on Fri, Jun 07, 2002 at 10:34:30AM %2B1000 References: <200206062029.g56KTej24391@freefall.freebsd.org> <20020607101000.R13287-100000@gamplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
* From Bruce Evans <bde@zeta.org.au> > 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 <jmallett@FreeBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020606181157.A8093>