...
| Code Block | ||
|---|---|---|
| ||
enum { BLOCKSIZE = 16 };
...
void *AllocBlocks(size_t cBlocks) {
size_t alloc;
if (cBlocks == 0 || cBlocks > SIZE_MAX / BLOCKSIZE) return NULL;
return malloc (cBlocks * BLOCKSIZE);
} /* end AllocBlocks */
|
...
| Wiki Markup |
|---|
\[[ISO/IEC 9899-1999|AA. C References#ISO/IEC 9899-1999]\] Section 7.20.3, "Memory Management Functions"
\[[Seacord 05|AA. C References#Seacord 05]\] Chapter 4, "Dynamic Memory Management," and Chapter 5, "Integer Security"
\[Coverity 07\|AA. C References#Coverity 07\] |
...
08. Memory Management (MEM)MEM36-C. Do not store the address of a variable into a longer life object 09. Input Output (FIO)