On Fri, Sep 07, 2001 at 05:46:26PM -0500, Chris Costello wrote:
> > 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.

That's not the only reason to do it.  Many people in the past have
gotten passwords out of various applications by making them core
dump, sifting through /dev/kmem, and other things.  While it's not
clear that his application might have these issues, I come from
the better safe than sorry school.  If you want to make a string
"empty", make it empty, don't just clobber the first character.

The void * is necessary to make lint happy.  It is not necessary
for the program to work right.

-- 
Leo Bicknell - [EMAIL PROTECTED]
Systems Engineer - Internetworking Engineer - CCIE 3440
Read TMBG List - [EMAIL PROTECTED], www.tmbg.org

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to