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.
-
Raw C++ pointers are passed into V8 callbacks and pending asynchronous tasks are not cancelled when the V8 context is destroyed.
Seen in 1 report
-
Raw C++ references to a restore entry were held across a call chain that could synchronously mutate and free the entry list.
Seen in 1 report
-
Raw iterators walked a mutable vector while synchronously invoking observer callbacks that could modify it.
Seen in 1 report
-
Raw pointers are held in a local vector across an operation that can trigger garbage collection.
Seen in 1 report
-
Raw pointers to a focused view were cached in locals and then code ran that could synchronously destroy that view, so the locals dangled.
Seen in 1 report
-
Raw pointers to buffer helpers were not cleared when transform feedback ended, and the dirty-bit handler did not check whether transform feedback was active.
Seen in 1 report
-
Raw pointers to default vertex attribute buffers were not cleared when the buffer helpers were deleted during a resize.
Seen in 1 report
-
Raw pointers to the navigation context were passed to observer callbacks without weak pointers or validity checks.
Seen in 1 report
-
Raw tagged pointers are cached on the C++ stack and not updated when a synchronous collection moves the array.
Seen in 1 report
-
Re-specifying a texture level bumps the global counter without invalidating attached framebuffers, so a wrapped counter lets a stale snapshot match.
Seen in 1 report
-
Reachability analysis ignores that descriptor-based casts can fail even when static types are subtypes, marking the false branch unreachable.
Seen in 1 report
-
$55,000 High
-
-
Read size is calculated from the biClrUsed header field while the buffer was allocated with a static size.
-
A length or offset is read from user-supplied data without checking it against the actual buffer size.
-
Reallocating the per-texture mip level array does not update or invalidate framebuffer attachment pointers that referenced the old array.
Seen in 1 report
-
Reassembly assumed the next-header field sat inside the extension header, but in an ESP packet it comes after the encrypted payload, so its offset could exceed the header buffer.
Seen in 1 report
-
Redefining a texture array level frees the storage object while an image object still references it.
Seen in 1 report
-
$2,500 High
-
-
Reference buffer indices from the renderer are copied into driver structures without checking each index is within the valid range.
Seen in 1 report
-
Reference counting on a netlink socket is decremented twice on one path, freeing a live object.
Seen in 1 report
-
Reference handling in node replacement frees an object that is still in use.
Seen in 1 report
-
The regexp interpreter writes match offsets into a fixed-size static offsets vector without checking that the number of capture positions fits.
Seen in 1 report
-
Register index and length supplied in expressions were not validated against the register array bounds.
-
Release of an invalid pointer or reference leads to memory corruption.
Seen in 1 report
-
Removing a synchronisation barrier from the cancel method lets the watcher be destroyed while an already-running OS callback still holds a raw pointer.
Seen in 1 report
-
Render bundles store only canvas context dependencies and not external texture objects or source ids, so the command buffer lacks the lifetime dependency checked at submit.
-
Renderer-supplied strings are passed to key-value coding methods without sanitisation.
Seen in 1 report
-
Renderer-supplied texture coordinates and resource sizes are not validated against the actual GPU texture dimensions.
Seen in 1 report
-
Reporting functions held raw pointers to the session across a callout into page JavaScript that could disconnect and free it.
Seen in 1 report
-
Request data from a destroyed memory pool was still referenced and passed into a string formatting function.
Seen in 1 report
-
Request header data is copied into a fixed-size stack buffer without a length check.
-
Request query data was copied into a fixed-size stack buffer without a length check.
Seen in 1 report
-
Request structures hold non-owning string views into state that can be destroyed before an asynchronous operation completes.
Seen in 1 report
-
A resource is accessed using an incompatible type.
Seen in 1 report
-
Restore delegates to the platform window, which can synchronously destroy the host through an observer, and then calls show on the freed object without a weak pointer check.
Seen in 1 report
-
Restore rebuilds queue pointers and driver status from separate saved fields without checking they agree.
Seen in 1 report
-
Resume validation did not check that the bound program matched the one active at begin, and cached buffer handles were not cleared when transform feedback ended.
Seen in 1 report
-
Resuming transform feedback recomputes capacity from the new buffer size but does not reset the accumulated write position.
Seen in 1 report
-
The return value of a memory reallocation was not checked for failure before the pointer was used in a write loop.
Seen in 1 report
-
The return value of object_init_ex is not checked, leaving a null object that is later dereferenced.
Seen in 1 report
-
Row pitch and Y offset are 32-bit signed integers whose product can overflow before being added to a 64-bit pointer.
Seen in 1 report
-
RSRC segment parsing does not validate loop counters and offsets before using them to compute addresses to clear.
Seen in 1 report
-
Sampler names are built by plain string concatenation and the only collision check is a debug-only assertion.
Seen in 1 report
-
Sanitisation mutates the limits array in place, freeing inline dictionaries still referenced elsewhere.
Seen in 1 report
-
Saved IP options are freed with a plain free instead of waiting for a grace period, so another CPU can still read them.
Seen in 1 report
-
Scale factors were fetched only for the last frame and reused for golden and altref frames with different resolutions.
Seen in 1 report
-
Scripting methods do not check the type of user-supplied data before using it.
Seen in 1 report
-
Sector count and sector size were multiplied in a 32-bit integer without an overflow check, so the allocation wrapped small while the copy loop still wrote the full number of entries.
-
Secure coding is disabled and no class allowlist is used when decoding archived objects.
Seen in 1 report
-
Selecting a bitmap into a different device context updates only one field and leaves a stale device pointer and hook flags.
Seen in 1 report
-
Separate variables for copy length and buffer allocation size are used with insufficient validation, allowing the allocation to be smaller than the copy.
-
Sequence parameters are only re-checked on IRAP pictures, so a non-IRAP slice can change resolution without triggering buffer reallocation.
Seen in 1 report