• 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: [OT] What kind of data is is returned by 'new' ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] What kind of data is is returned by 'new' ?


  • Subject: Re: [OT] What kind of data is is returned by 'new' ?
  • From: Bill Bumgarner <email@hidden>
  • Date: Sat, 9 Jul 2005 10:19:52 -0700

On Jul 8, 2005, at 4:26 PM, Dirk Stegemann wrote:
Actually, this is great because I thought of using such buffers as seed to a random function. So, I'm wondering if it's posssible for someone hassling around with my app to circumvent this randomising mechanism by somehow telling the system to *always* make 'new' return zero'd buffers... e.g., in DEBUG mode compiled applications will get allocated memory filled with 0xCC values (on Win32 systems).

The bytes aren't random. They are very much predetermined values based upon the state of your application prior to that call to malloc (). They may seem random, but it is very likely a rather small set of values.


See the 'urandom' man page. If you want a good random seed, open / dev/random (or /dev/urandom) and read however much data you might want.

b.bum

_______________________________________________
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


  • Follow-Ups:
    • Re: [OT] What kind of data is is returned by 'new' ?
      • From: Dirk Stegemann <email@hidden>
References: 
 >[OT] What kind of data is is returned by 'new' ? (From: Dirk Stegemann <email@hidden>)
 >Re: [OT] What kind of data is is returned by 'new' ? (From: Mark Bessey <email@hidden>)
 >Re: [OT] What kind of data is is returned by 'new' ? (From: Dirk Stegemann <email@hidden>)

  • Prev by Date: Re: Problem setting dependencies to custom framework
  • Next by Date: Asm blocks not working?
  • Previous by thread: Re: [OT] What kind of data is is returned by 'new' ?
  • Next by thread: Re: [OT] What kind of data is is returned by 'new' ?
  • Index(es):
    • Date
    • Thread