Re: Where's the buffer overrun?
Re: Where's the buffer overrun?
- Subject: Re: Where's the buffer overrun?
- From: Andrew Farmer <email@hidden>
- Date: Wed, 19 Mar 2008 17:00:33 -0700
On 19 Mar 08, at 16:50, Chris Suter wrote:
On 20/03/2008, at 10:38 AM, Nick Zitzmann wrote:
char **returnArray = NSZoneMalloc([self zone], length);
should be:
char **returnArray = NSZoneMalloc([self zone], length * sizeof
(char *));
Actually, that's correct. Read up a bit - length is already multiplied
by the pointer size.
What's bothering me a lot more is the use of an appendByte: method.
NSMutableData doesn't document the existence of such a method. I'm not
sure why this would cause guard_malloc to choke *later on*, but it's
certainly something to look at.
A traceback would be good, too. Is the guard_malloc error in the OP's
function, or in Apple's code somewhere?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden