In-depth lesson · Memory corruption
Typical fixes
Every point the Memory corruption reports back under this heading, best-backed first, each with the reports it is seen in.
-
Validate the size and contents of user-supplied data before writing to a memory buffer.
Seen in 1 report
-
Validate the size of data in protocol messages before copying into a heap buffer.
-
Validate the size of decoded license data against the allocated buffer before copying.
Seen in 1 report
-
Validate the size of user-supplied data before arithmetic.
-
Validate the total Huffman entry count against the allocated table size.
Seen in 1 report
-
Validate the type of file-supplied data before using it.
-
Validate the type of objects referenced by the associated file entry before using them.
Seen in 1 report
-
Validate the type of the first argument to checkThisBox.
Seen in 1 report
-
Validate the type of the object passed to addIcon.
Seen in 1 report
-
Validate the type of the object passed to the colour conversion page function.
Seen in 1 report
-
Validate the user-supplied MTU value against the allocated buffer size before using it in memory calculations.
Seen in 1 report
-
Validate user-supplied array indexes before using them to access memory.
-
Validate user-supplied data before writing to memory in the driver.
-
Validate user-supplied data length before copying.
Seen in 1 report
-
Validate user-supplied data to prevent integer underflow before writing to memory.
-
Validate user-supplied parameters before computing the allocation size in the PUBLISH handler.
-
Validate user-supplied size data before allocating a buffer.
Seen in 1 report
-
Validate user-supplied sizes before buffer allocation to prevent integer overflow.
Seen in 1 report
-
Validate user-supplied values before using them in size calculations.
Seen in 1 report
-
Verify the claimed size fits within the remaining buffer before copying.
-
Verify the output buffer has enough space before writing decompressed data.
Seen in 1 report
-
Verify the parser level is within bounds before using it as an array index.
Seen in 1 report
-
Verify the type of arguments before calling string length macros on them.
-
Widen the integers in the size check so the sum cannot overflow to a negative value.
Seen in 1 report
-
XOR each stored free-list pointer with a per-process value so a plain overflow cannot redirect allocations.
Seen in 1 report
-
Zero the destination register when skipping an out-of-bounds read on a fat pointer.
Seen in 1 report