[SOLVED] Re: Where's the buffer overrun?
[SOLVED] Re: Where's the buffer overrun?
- Subject: [SOLVED] Re: Where's the buffer overrun?
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 19 Mar 2008 19:20:22 -0600
On Mar 19, 2008, at 6:18 PM, Chris Suter wrote:
I think it's because
[NSMutableData dataWithBytesNoCopy:returnArray length:length]
is releasing returnArray and allocating a new buffer for it. I'm
guessing that's because it's NSMutableData.
To fix it, use NSData instead.
Ding ding ding! I would have never guessed that -[NSMutableData
dataWithBytesNoCopy:...] throws away the original bytes (odd
behavior), and the NSData version doesn't (expected behavior), but now
when I run the code, Guard Malloc no longer crashes.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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