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.
-
Data in Mach messages is interpreted as the wrong type.
Seen in 1 report
-
Data owned by a host window is freed when the window is destroyed while a moved handler still references it.
Seen in 1 report
-
Data within project files used to access memory without size validation.
Seen in 1 report
-
Decoder classes did not initialise their full state in constructors and relied on the caller to configure them before the first item.
Seen in 1 report
-
Decrypted data is written into a fixed-length stack buffer without checking the input length.
Seen in 1 report
-
Decrypted message data is copied into a fixed-length heap buffer without validating its length.
Seen in 1 report
-
Default buffer alignment omitted the device nonCoherentAtomSize and the flush/invalidate code rounded the size up without aligning the offset or clamping the end to the mapped block.
Seen in 1 report
-
Default COM reference counting let destruction happen on a background thread while a weak-pointer task on the media thread was being checked and invoked.
Seen in 1 report
-
Defaulted move operations shallow-copy a raw pointer without transferring ownership, so the moved-from object frees the buffer in its destructor.
Seen in 1 report
-
Deleting an element decrements the counter and nulls pointers, so a later insert computes an index that overwrites an existing element.
-
Deleting CSS rules freed memory but a dangling pointer was dereferenced later, a use-after-free.
Seen in 1 report
-
Deletion handling checks only whether the deleted node itself is edited, not whether it is an ancestor of an edited node.
Seen in 1 report
-
DeoptimizeFunction uses the default code argument instead of the executing OSR code, so the OSR code is not marked for deoptimisation.
Seen in 1 report
-
Dereferencing a pointer influenced by a local user without validation.
-
Derived frame destructors nulled the ArrayBuffer before the base destructor could detach it, so the backing store was freed while referenced.
-
Derived members are destroyed before base members, unloading libraries still referenced.
Seen in 1 report
-
Descriptor subtyping is applied to unrelated struct types, so a cast between them succeeds.
Seen in 1 report
-
$55,000 High
-
-
Deserialisation does not reject non-finite floating-point values that are later used as ordered map keys.
Seen in 1 report
-
Deserialisation passes only the shared memory data pointer and never checks that image dimensions fit the mapping.
Seen in 1 report
-
Destroy command buffer removed a route even when it was not a command buffer stub, and the deferred flush dereferenced a map lookup result without checking for the end.
Seen in 1 report
-
Destroy unregisters the network callback and deletes the native object but does not purge already queued callbacks.
Seen in 1 report
-
Device emulation did not check for null function pointers or return values from queue operations.
-
Device-supplied strings are concatenated into a format string and passed as the format argument.
-
DHCP option data length is not validated before copying into a fixed-size stack buffer.
-
Dimensions are multiplied without an overflow check, so a huge shape produces a small allocation.
Seen in 1 report
-
DirectX mishandles objects in memory, allowing kernel-mode code execution.
Seen in 1 report
-
Divisibility of buffer size by render quantum was only checked with a debug assertion removed in release builds.
Seen in 1 report
-
Driver does not validate that output register operands in shader bytecode stay within the range declared by the shader.
-
Driver fails to properly validate shader operands, leading to a double free when the shader is compiled.
Seen in 1 report
-
Driver fails to validate shader instruction operands, allowing a corrupted pointer to be passed to a memory reallocation function.
Seen in 1 report
-
Driver fails to validate the source register index of the round_ni shader instruction, so an out-of-range register leads to an out-of-bounds write during a memory set.
-
Dynamically sized stack allocations are placed below the saved registers and stack guard, so a contiguous overflow reaches the return address.
-
Each call created a new subscription storing the same raw pointer but only the most recent subscription was unsubscribed, leaving earlier callbacks dangling.
-
EHCI component fails to validate the length of user-supplied data before copying into a heap buffer.
Seen in 1 report
-
Engine mishandles object types during replacement in RegExp.replace.
-
Errors during parsing of entries are not handled properly, leaving the parser in a bad state.
-
Escape analysis elided the this object when a constructor returned a constant, but the Error constructor later tried to access it.
Seen in 1 report
-
Escape helpers sized a stack buffer for a 256-byte name but never bounded the caller-supplied length before escaping.
Seen in 1 report
-
Event dispatch held a raw reference to content that script could free during a mouseout handler before the reference was used.
Seen in 1 report
-
Event handler cleanup freed parts of an object while a script reference to it was still held.
Seen in 1 report
-
Exactness of the input reference is propagated to the result while using the encoded immediate type's descriptor.
Seen in 1 report
-
$55,000 High
-
-
Example code copies a host string without verifying it fits the destination buffer.
Seen in 1 report
-
Exiting fullscreen can synchronously destroy the web contents and its print manager, but the code does not re-check the object before continuing.
Seen in 1 report
-
Extension data is freed after a failed allocation but the lookup still dereferences the stale pointer.
Seen in 1 report
-
Fake reference counting plus a destroy method that deletes the object without waiting for pending thread pool callbacks.
Seen in 1 report
-
Fast rundown allowed off-thread destruction, a check was removed in release builds, and a global map was accessed from two threads without synchronisation.
Seen in 1 report
-
Feature installation added properties without checking for an existing key, so a lookup later selected the old descriptor index.
Seen in 1 report
-
Field reordering is not applied recursively to nested structs, so a later pass strips sampler fields and uses an original field index on the shortened list.
Seen in 1 report
-
Fields defined as narrow values in a specification are represented as wider integers over IPC and never range-checked before use.
Seen in 1 report
-
File data is read into a fixed buffer without null termination, then string functions run past the end.
Seen in 1 report