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.
-
Check the counter before linking the node, or size the pool from the actual list length.
Seen in 1 report
-
Check the credential length before copying into the fixed-size stack buffer.
Seen in 1 report
-
Check the decoded trailer ID length before writing it into the heap buffer.
Seen in 1 report
-
Check the destination buffer size before concatenating the coordinate file path.
Seen in 1 report
-
Check the destination buffer size before copying data into it during read-until parsing.
Seen in 1 report
-
Check the document is still alive before downcasting the script execution context.
Seen in 1 report
-
Check the escape character count calculation for overflow.
Seen in 1 report
-
$7,000 High
-
-
Check the filename size increment for wraparound before copying.
Seen in 1 report
-
Check the length accumulator for overflow and verify the buffer is large enough before bulk appending.
Seen in 1 report
-
Check the length of attacker-controlled data before copying it into a fixed-size stack buffer.
-
Check the length of file-supplied data before copying it into a fixed-size stack buffer.
-
Check the length of guest-supplied data before copying it into a fixed-size heap buffer.
Seen in 1 report
-
Check the length of playlist entries before copying and converting them.
Seen in 1 report
-
Check the length of the target parameter after URL decoding.
-
Check the length of the user name before copying it into the stack buffer.
Seen in 1 report
-
Check the length of user-supplied data before copying it into a fixed-length stack buffer.
-
Check the number of SLC entries before writing into the global buffer.
-
Check the path length against the stack buffer size before concatenating.
-
Check the property length from the file against the destination buffer size before copying.
Seen in 1 report
-
Check the prototype value as well as the target object before allowing it to be set.
Seen in 1 report
-
$10,000 High
-
-
Check the provider name length against the stack buffer capacity before copying.
Seen in 1 report
-
Check the range of converted numbers rather than trusting the conversion result.
-
Check the reference tile width multiplication for integer overflow before sizing the heap buffer.
Seen in 1 report
-
Check the return value and output pointer of digest context finish functions before dereferencing.
Seen in 1 report
-
Check the return value of stream reads before using the resulting data.
-
Check the return value of the virtqueue chain fetch before using the iovec array.
-
Check the seal initialisation return value and validate the per-key encrypted lengths before using them as a copy size.
Seen in 1 report
-
Check the size multiplication for integer overflow before allocating the surface.
Seen in 1 report
-
Check the size of data received from a server before copying into a heap buffer.
-
Check the size of incoming data before writing into a fixed buffer when unfolding or decompressing HTTP data.
Seen in 1 report
-
Check the snprintf return value for errors and treat negative lengths as failures before resizing or advancing the offset.
Seen in 1 report
-
Check the string count multiplication for overflow before allocating the pointer array.
Seen in 1 report
-
Check the string reader's return value before passing it to the tokeniser.
Seen in 1 report
-
Check the super page and writable bits in the fast path and stop allowing the super page flag in the disallow mask.
Seen in 1 report
-
Check the UUID conversion return value before freeing the pointer.
Seen in 1 report
-
Check the width times bytes-per-pixel multiplication for integer overflow.
Seen in 1 report
-
Critical
-
-
Check the write index against the array size on every line, not just at allocation time.
Seen in 1 report
-
Check whether a binding already exists before initialising its type.
Seen in 1 report
-
Check whether a child is already attached before attaching it again, and reject duplicate entries in the child array.
Seen in 1 report
-
Check whether a cookie was already removed or freed before freeing it again.
-
Check whether a deleted node is an ancestor of any edited node, not just whether it is edited itself.
Seen in 1 report
-
Check whether stream reads failed, and refuse to allocate a zero-length buffer when the total size is zero.
Seen in 1 report
-
Clamp and range-check window size values received from a proxy.
Seen in 1 report
-
Clean up the paused query registry on early exit, not only in debug assertions.
Seen in 1 report
-
Clear a child document's parent pointer when the document is destroyed.
Seen in 1 report
-
Clear cached translations whenever the underlying address is changed.
-
Clear or re-check the target element pointer when the element is removed and collected.
Seen in 1 report
-
Clear or revalidate the raw pointer to the media session service when it is destroyed on disconnect.
Seen in 1 report
-
Clear references to a freed page buffer in the parent object.
Seen in 1 report
-
Clear stale pointers in the old sync group when an audio stream moves to a new group.
Seen in 1 report