• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Newbie question: error in creating a NSData object using handle(Resource Management)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >RE: Newbie question: error in creating a NSData object using handle(Resource Management) (From: "Gary L. Wade" <email@hidden>)

  • Prev by Date: Re: Adding a new type of NSButton
  • Next by Date: How to use .a in XCode?
  • Previous by thread: RE: Newbie question: error in creating a NSData object using handle(Resource Management)
  • Next by thread: How to use .a in XCode?
  • Index(es):
    • Date
    • Thread