Re: Newbie question: error in creating a NSData object using handle(Resource Management)
Re: Newbie question: error in creating a NSData object using handle(Resource Management)
- Subject: Re: Newbie question: error in creating a NSData object using handle(Resource Management)
- From: Jens Alfke <email@hidden>
- Date: Wed, 25 Jun 2008 13:37:58 -0700
Handle dataHandle = Get1IndResource( type1, n);
....
I hope you checked that dataHandle!=NULL and *dataHandle!=NULL.
struct A_STRUCT aStruct;
memcpy(& aStruct,[data bytes], [data length]);
This is dangerous — if [data length] is larger than sizeof(aStruct),
you've just clobbered your stack. If it's smaller, you've left part of
aStruct uninitialized with garbage bytes in it. Either of those
situations is likely to cause a crash, especially the former because
it can very easily be abused by hackers to take control of your app.
After several times looping through the list, I got an error in the
line
above.
What error, specifically? How are we supposed to tell you how to
correct the error if you won't tell us what it is?!
—Jens_______________________________________________
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