Vulnerability Development mailing list archives

RE: Administrivia: List Announcement


From: Michael Wojcik <Michael.Wojcik () microfocus com>
Date: Wed, 14 May 2003 07:44:15 -0700

From: Wynn Fenwick [mailto:wynn.fenwick () cgi com] 
Sent: Tuesday, May 13, 2003 4:44 PM

The program uses malloc() then iterates through each memory
location, assuming that malloc() would give them a contiguous block 
of memory.

It may not *actually* be the case that memory returned by a single call to
malloc will be a "contiguous block".  In fact, for various interpretations
of "contiguous block", this will frequently be the case in many modern
implementations.  However, by the as-if rule, within any C program that
doesn't invoke Undefined Behavior, running on a conforming implementation,
it must be valid to access the contents of a block returned by malloc as the
members of an array that fits in that block, or as an array of unsigned
char.  From the program's point of view, such arrays are always contiguous.

Michael Wojcik
Principal Software Systems Developer, Micro Focus


Current thread: