Re: errno in debug vs. release
Re: errno in debug vs. release
- Subject: Re: errno in debug vs. release
- From: John W Noerenberg II <email@hidden>
- Date: Tue, 7 Feb 2006 18:03:20 -0800
At 1:21 PM -0800 2/7/06, Steve Checkoway wrote:
So with the release configuration free releases unallocated memory
and malloc clobbers the heap.
This is programmer error. You allocated 0 bytes and then tried to
write over it.
Actually, the point of this program was to illustrate a programmer
error. :-) Say you compute the size of a buffer to be allocated
based on some user input. If your program doesn't validate the
result of the operation, it could lead to memory allocation errors
which become vulnerabilities that could be exploited by a hacker.
That's the motivation for why Sys V treats malloc(0) as an error condition.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden