** Reply to message from "Paul G. Allen" <[EMAIL PROTECTED]> on Sun, 04
May 2008 05:06:56 -0700

> It is bad programming practice (and usually a big mistake, and 
> always a security risk) to assume that allocated memory is initialized 
> to zero.

no need to assume, malloc does not initialize to zero the memory, you
can call memset to do initiate allocation and initialization. But better yet,
calloc reserves the memory but only allocates and initializes the memory
when it is first used. Calloc initializes to zero. The choices are there for
the developer.

And if you don't trust calloc does the initialization then check the source.
Same for memset.

Doug


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to