Re: Administrivia: List Announcement
From: Luciano Miguel Ferreira Rocha (strange_at_nsk.no-ip.org)
Date: 05/14/03
- Previous message: Nexus: "Re: partial analysis of vulndev-1.c"
- In reply to: Brian Hatch: "Re: Administrivia: List Announcement"
- Next in thread: Bennett Todd: "vulndev-1.c challenge (was Re: Administrivia: List Announcement)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 14 May 2003 15:45:29 +0100 To: vuln-dev@securityfocus.com
On Tue, May 13, 2003 at 10:45:21AM -0700, Brian Hatch wrote:
> And for goodness sake, let's cast things properly if you're going
> to malloc, and for good form include the size of the element, even
> when it's a char:
>
> char *buf1 = (char*)malloc( SIZE * sizeof(char) );
No, bad idea.
If malloc isn't defined, the compiler will cast an int to a pointer, which
may not be the same size.
If malloc is (well) defined, it returns a type of (void *), well casted to
any pointer by the compiler.
Regards,
Luciano Rocha
- Previous message: Nexus: "Re: partial analysis of vulndev-1.c"
- In reply to: Brian Hatch: "Re: Administrivia: List Announcement"
- Next in thread: Bennett Todd: "vulndev-1.c challenge (was Re: Administrivia: List Announcement)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|