As I said, "off the top of my head."  Thanks for catching that.

I can't believe I still get confused over pointers.  I ususally have to
print several versions of my vars to make sure I'm referencing the right
information.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Gabriel Sechan
> Sent: Tuesday, February 15, 2005 11:44 AM
> To: [email protected]
> Subject: Re: getenv() obfuscated for buffer overflow prevention?
>
>
>
>
> >From: Scott McClelland <[EMAIL PROTECTED]>
> >
> >Change (off the top of my head, without testing):
> >char * username=getenv("USER");
> >fprintf(log_file, "By user %s \n" &username, );
> >
> The & is not needed.  With the & you're passing a char ** instead of a
> char*, and will have a bad memory error of some sort.
>
>
> Gabe
>
>
> --
> [email protected]
> http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to