From owner-freebsd-hackers Fri Sep 7 15:46:34 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from holly.calldei.com (adsl-208-191-149-190.dsl.hstntx.swbell.net [208.191.149.190]) by hub.freebsd.org (Postfix) with ESMTP id CC5E437B403 for ; Fri, 7 Sep 2001 15:46:30 -0700 (PDT) Received: (from chris@localhost) by holly.calldei.com (8.11.4/8.9.3) id f87MkRp00985; Fri, 7 Sep 2001 17:46:27 -0500 (CDT) (envelope-from chris) Date: Fri, 7 Sep 2001 17:46:26 -0500 From: Chris Costello To: Leo Bicknell Cc: FreeBSD Hackers Subject: Re: tiny patch to pkg_add Message-ID: <20010907174626.A548@holly.calldei.com> Reply-To: chris@calldei.com References: <20010907150416.A38565@dub.net> <20010907151935.A40146@dub.net> <20010907183242.A66179@ussenterprise.ufp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010907183242.A66179@ussenterprise.ufp.org>; from bicknell@ufp.org on Fri, Sep 07, 2001 at 06:32:42PM -0400 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Friday, September 07, 2001, Leo Bicknell wrote: > I think Chris's version is right, although if you're writing a > security app, or just want to be overly paranoid in general > you could use: > > bzero((void *)packagesite, sizeof(packagesite)); That's unnecessary unless you know you're going to be reading data from that string starting somewhere other than &packagesite[0];. And the `void *' cast is unnecessary, as an array is converted to a pointer when passed to a function, and any data pointer is also implicitly converted to a `void *' pointer where necessary. -- +-------------------+------------------------+ | Chris Costello | Save energy: | | chris@calldei.com | Drive a smaller shell. | +-------------------+------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message