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.
-
Cancel the scroll-into-view event when the frame selection is destroyed.
-
Canonicalise NaN through the standard number conversion instead of the raw float setter.
-
Carry output padding and output sizes through the message type.
Seen in 1 report
-
Check an attacker-controlled count against the fixed array size before looping.
Seen in 1 report
-
Check arithmetic on length values for overflow before using the result to allocate a buffer.
-
Check arithmetic on user-supplied sizes for overflow before allocating buffers.
Seen in 1 report
-
Check for integer overflow before adding lengths and allocating.
Seen in 1 report
-
Check for integer overflow before allocating a buffer.
Seen in 1 report
-
Check for integer overflow before multiplying palette counts and allocating.
Seen in 1 report
-
Check for integer overflow in the offset and size sum before the bounds check.
Seen in 1 report
-
Check for integer overflow when adding string lengths and extra space before allocating.
Seen in 1 report
-
Check for integer overflow when calculating buffer sizes from lengths.
Seen in 1 report
-
Check for integer overflow when calculating image allocation size.
Seen in 1 report
-
Check for integer overflow when calculating the needed buffer size for large width and precision values.
Seen in 1 report
-
Check for overflow before adding to a clipboard-supplied size.
Seen in 1 report
-
Check for overflow during repeated left shifts in the chunk size calculation.
Seen in 1 report
-
Check for overflow when adding one to a length before allocating.
Seen in 1 report
-
Check integer calculations for overflow or wraparound before using the result as a size.
Seen in 1 report
-
Check length and offset fields against the real buffer size before reading.
-
Check packet length and field values against the destination buffer size before writing.
-
Check teardown results in release builds and stop the callback thread before deleting the stream.
Seen in 1 report
-
Check that a character follows a backslash before advancing the parser.
Seen in 1 report
-
Check that a form field object is still valid after event handling frees it.
Seen in 1 report
-
Check that a pointer calculated from an attacker-controlled length stays within the packet buffer.
Seen in 1 report
-
Check that an element exists before assuming it does when only a closing tag is present.
Seen in 1 report
-
Check that enough bytes remain before reading a character at the current position.
Seen in 1 report
-
Check that facility name copy loops stay within the allocated buffer size.
Seen in 1 report
-
Check that offsets are non-negative as well as within upper bounds.
Seen in 1 report
-
Check that one string has ended before advancing both pointers past a space.
Seen in 1 report
-
Check that the base name length is greater than zero before indexing the last character.
Seen in 1 report
-
Check that the bit counter stays non-negative before using it as an index into the masks array.
Seen in 1 report
-
Check that the computed packet length fits in the allocated cluster before building the packet.
Seen in 1 report
-
Check that the dispatcher still exists after a callback that can destroy it.
Seen in 1 report
-
Check that the IME content observer is still alive before a pending key event uses it.
Seen in 1 report
-
Check that the input length is at least the tag length before subtracting it.
-
Check that the input string is null-terminated before passing it to a length-based duplication.
Seen in 1 report
-
Check that the last row has at least the number of bytes the predictor assumes before reading or writing.
Seen in 1 report
-
Check that the remaining input holds the declared string length before copying.
-
Check that the requested heartbeat length matches the actual payload length.
Seen in 1 report
-
Check that the scalar holds a string before reading its raw pointer.
-
Check that the selection's frame is still alive before moving the caret.
Seen in 1 report
-
Check that the transaction count matches the hash count before iterating.
Seen in 1 report
-
Check the addition of buffer length and new data length for wraparound before the capacity check.
Seen in 1 report
-
Check the allocation size calculation for integer overflow before copying the payload.
-
Check the Authorization header length before copying into the fixed-size buffer.
-
Check the buffer table reference count before destroying a GEM handle on the import error path.
Seen in 1 report
-
Check the caller's declared send and receive buffer sizes before writing or reading.
-
Check the caller-supplied output buffer size against the volume sector size before copying.
Seen in 1 report
-
Check the chain size addition for integer overflow before allocating.
Seen in 1 report
-
Check the count against the fixed array size while parsing translation vectors.
Seen in 1 report