You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Calling free() on a block of dynamic memory marks that memory for deallocation. Once deallocated, the block of memory is made available for future allocation. However, the data stored in the block of memory to be recycled may be preserved. If this memory block contains sensitive information, that information may be unintentionally exposed. This phenomenon is referred to as heap inspection [ref]. To prevent heap inspection it is necessary to clear sensitive information from dynamically allocated buffers before they are freed.

Non-Compliant Code Example 1

Compliant Solution 1

  • No labels