Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wiki Markup
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[http://vulncat.fortifysoftware.com/2/HI.html] and [http://samate.nist.gov/docs/SAMATE_source_code_analysis_tool_spec_09_15_06.pdf]\]. To prevent heap inspection it is necessary to clear sensitive information from dynamically allocated buffers before they are freed.

...

Code Block
bgColor#ccccff

Risk Assessment

Failure to clear memory can result in leaked information. Occasionally, it can also lead to buffer overflows when programmers assume, for example, a null termination byte is present when it is not.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

MEM33-C

2 (medium)

1 (unlikely)

3 (low)

P6

L2

Refernces

http://vulncat.fortifysoftware.com/2/HI.html
http://samate.nist.gov/docs/SAMATE_source_code_analysis_tool_spec_09_15_06.pdf
MEM33-C. Do not assume memory allocation routines initialize memory