Re: [OT] What kind of data is is returned by 'new' ?
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