In-depth lesson · Memory corruption
Root causes
Every point the Memory corruption reports back under this heading, best-backed first, each with the reports it is seen in.
-
The return value of the key serialisation call is ignored, so a failure leaves caller-supplied buffers uninitialised or stale.
-
The return value of the object identifier to text function is treated as bytes written when it is the total length needed.
Seen in 1 report
-
The return value of the seal initialisation was not checked and the per-key encrypted lengths were not validated before use as a copy size.
Seen in 1 report
-
The return value of the string reader is not checked before being passed to the tokeniser.
Seen in 1 report
-
The return value of the tree unserialise call was ignored and an invalid node id check was non-fatal, so a dangling pointer was stored.
Seen in 1 report
-
The return value of the UUID conversion was not checked, so a pointer to static memory was freed on failure.
Seen in 1 report
-
The return value of the virtqueue chain fetch is not checked, so on failure an uninitialised iovec array is used.
-
The rewrite pass follows the left operand of a comma operator instead of the right and its rebuild switch has no case for comma nodes, so release builds drop them.
Seen in 1 report
-
The rewriter's stack overflow flag was not checked before using a replacement node, so a partial AST was consumed as complete.
Seen in 1 report
-
The rls-login handler copies user-supplied data into a fixed-length stack buffer without validating its length.
-
The rotated copy path uses debug-only bounds checks, so a mismatch between cached and live texture dimensions gives negative offsets and out-of-bounds pointer arithmetic.
Seen in 1 report
-
The router read the message length from an unchecked field and built the onward message before verifying the clove stayed within the received buffer.
Seen in 1 report
-
The row stride is stored in a 32-bit signed integer, so a large 64-bit stride is narrowed to a negative value and sign-extended during pointer arithmetic.
Seen in 1 report
-
The row-count sum in the packing limit check is done in signed integers without overflow protection, so a large number of matrix uniforms wraps the total negative.
Seen in 1 report
-
The RTSP server copied a user-supplied length of data into a fixed 2048-byte stack buffer without checking the length.
Seen in 1 report
-
The RTSP server copies the Authorization header into a fixed-length stack buffer without checking its length.
-
The RTSP server does not check the length of the username in the Authorization header before copying it into a fixed-length stack buffer.
-
The rule removal function freed an object and then accessed it again.
Seen in 1 report
-
The runtime copied arguments and environment variables into memory without checking the total length, so a long input overwrote the module bytecode.
Seen in 1 report
-
The runtime manager destructor does not unregister itself from the GPU data manager observer list, leaving a dangling pointer used for virtual dispatch.
Seen in 1 report
-
The same allocation released more than once.
Seen in 1 report
-
The same memory allocation is freed more than once.
Seen in 1 report
-
The same memory block is freed twice during cleanup after an HTTP proxy connection with a non-HTTP protocol.
Seen in 1 report
-
The same private data object was stored in two places without reference counting, so finalising the timer freed memory still in use.
Seen in 1 report
-
The same socket was added to a global list twice, corrupting the list and causing a double-free.
Seen in 1 report
-
The sample count calculation multiplied frames by channel count without an integer overflow check, so the allocation wrapped while the write did not.
-
The scale argument was not checked to be non-negative, so a negative value corrupted internal state.
Seen in 1 report
-
The scheduler used a user-supplied MTU value in memory calculations without validating it against the allocated buffer size.
Seen in 1 report
-
The script load context was destroyed while a pending dynamic import still held a reference to it.
Seen in 1 report
-
The scroll-into-view event holds a non-owning reference to the frame selection, which the cycle collector frees before the event runs.
Seen in 1 report
-
The scroll-into-view event is not cancelled when the frame selection is destroyed, so it holds a reference to freed memory.
-
The scrolling-element lookup holds a raw pointer to the body element across a script callback that can run garbage and cycle collection.
Seen in 1 report
-
The SDK fails to validate the number of audio channels, and the calculation of already played bytes uses a bit shift that is incorrect for channel counts other than 1 or 2.
-
The second chroma QP index offset field was not range-checked against the spec range while its sibling field was.
Seen in 1 report
-
The secondary map is populated with a raw pointer before the primary map insert succeeds, so a duplicate key failure leaves a dangling pointer.
Seen in 1 report
-
The sector size read from the file is not checked to be at least 4, so the offset calculation underflows.
Seen in 1 report
-
The SecurityManager could be reached and manipulated from within the same process.
-
The selection listener keeps a reference to a document viewer destroyed when the iframe's document shell is torn down.
Seen in 1 report
-
The send path is judged idle by handle validity, but the handle is moved into a pending buffer during a write.
Seen in 1 report
-
The separator counter is a signed integer with no lower-bound check, so it can wrap negative and be treated as a repeat-last count by the C++ sink.
Seen in 1 report
-
The server accepted uploaded files without enforcing a maximum size before processing them.
Seen in 1 report
-
The server calculated the response buffer size without including the size of each opcode, so the buffer was too small by four bytes per operation.
-
The server does not verify a key exchange init arrived before accepting new keys, so an uninitialised function pointer is used.
Seen in 1 report
-
The server enabled anonymous key exchange cipher suites that perform no server authentication.
-
The server read a fixed size into a buffer at an offset without checking remaining space.
Seen in 1 report
-
The server stores a client-controlled frame size from one message and later uses it to size a copy into a buffer allocated from a different, smaller message.
-
The server trusted the client-supplied rectangle count and processed more rectangles than the data contained without validating count or coordinates.
Seen in 1 report
-
The server uses the NextCommand field as a length in HMAC calculations without validating it, causing an integer overflow.
Seen in 1 report
-
The service deserialises data from a location an ordinary local user can influence without validating what that data can construct.
-
The service did not check the length of incoming FTP commands before copying them into a fixed-size heap buffer used for logging.
Seen in 1 report