Skip to content

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.

Back to the lesson 3,601 to 3,650 of 3,817
  1. The stride calculation can produce a negative value that is used as a size argument without validation.

    Seen in 1 report
  2. The stride calculation returns zero on integer overflow, bypassing the size check, and 32-bit pitch and row count values overflow further.

    Seen in 1 report
  3. The stride times height multiplication overflowed, so the buffer was allocated smaller than the data later written into it.

    Seen in 1 report
  4. The strip count is recomputed instead of using the stored value, which is wrong in strip chop mode where the stored count is modified.

    Seen in 1 report
  5. The struct uses a pointer array instead of a flexible array, so the allocated space is too small for the string being copied.

    Seen in 1 report
  6. The structured clone implementation mishandles the data tag of a transferred object so the expected alloc or mapped tag invariant does not hold.

    Seen in 1 report
  7. The style context is freed by a resize while still referenced during innerText reading.

    Seen in 1 report
  8. The subscription handler writes each requested quality-of-service byte into a fixed 512-byte stack array and increments the index without a bounds check.

    Seen in 1 report
  9. The substitution code failed to refresh its saved pointers after the line buffer was reallocated, and buffer sizes were held in signed ints that overflow at large sizes.

    Seen in 1 report
  10. The suggested YCbCr model field is not bounds checked during deserialisation and bit-packing, so an oversized value corrupts an adjacent field.

    Seen in 1 report
  11. The sum of current length and appended count can overflow, leading to an undersized allocation and out-of-bounds writes.

    Seen in 1 report
  12. The sum of three unsigned 32-bit header lengths wraps before being stored in a signed int, so the buffer is undersized.

    Seen in 1 report
  13. The sum of two 32-bit fields overflows before being widened to 64 bits, producing a small block size.

    Seen in 1 report
  14. The sum of two 32-bit integers overflowed before the bounds check, allowing an out-of-bounds read.

    Seen in 1 report
  15. The Swift reader disabled secure coding and decoded the archive without an allowlist of permitted classes, unlike the hardened Objective-C counterpart.

    Seen in 1 report
  16. The sync loop iterated a by-value snapshot of dirty bits, so a reentrant dirty bit set during texture respecification was ignored and a stale cache entry was dereferenced.

    Seen in 1 report
  17. The tag length was subtracted from the input length without first checking the input was at least as long as the tag.

    Seen in 1 report
  18. The target location is cached before the right-hand side is evaluated, so side effects are not reflected in the final store.

    Seen in 1 report
  19. The target parameter is URL-decoded without a length check, leading to a stack buffer overflow.

    Seen in 1 report
  20. The TCP/IP driver failed to validate the size or type of IPv6 extension headers within IPSec ESP packets.

    Seen in 1 report
  21. The terminate method copies the renderer member to a local but never clears the member, so a strong reference survives and destruction happens on the wrong thread.

    Seen in 1 report
  22. The texImage2D implementation did not validate the supplied width and height against UNPACK_IMAGE_HEIGHT, so the depth texture initialisation shader accessed memory outside the pixel unpack buffer.

    Seen in 1 report
  23. The text control's editor state is freed by cycle collection while a pending selection command still holds a reference to it.

    Seen in 1 report
  24. The texture format cache was updated for texImage2D levels that had no native storage, leaving the cached format out of step with the real Metal texture layout.

    Seen in 1 report
  25. The texture-image state sync list omitted the pack-state dirty bits, so a previously synced pack row length was not reset before the CPU readback.

    Seen in 1 report
  26. The throttle calls a page close synchronously during navigation, destroying itself, then continues to use its own pointer.

    Seen in 1 report
  27. The tier-up runtime function used the signature from the importing module rather than the module that owns the function table.

    Seen in 1 report
  28. The TIF parser fails to validate a user-supplied size or count, leading to an integer overflow before a memory write.

    Seen in 1 report
  29. The tile list parsing code does not check the input length before copying it into a fixed-size stack buffer.

    Seen in 1 report
  30. The tile memory fallback clears the flag without removing the image from the context tracking list, leaving a dangling pointer.

    Seen in 1 report
  31. The timeline's fence list does not increment the reference count of the fence objects it holds, so a fence can be freed while still on the list.

    Seen in 1 report
  32. The timeout handler erased entries and freed their nodes before running error callbacks that synchronously finished other requests.

    Seen in 1 report
  33. The timeout timer swapped the request timeout set into a local set and back, so an entry inserted by a re-entrant callback stayed only in the local set and was freed when it went out of scope.

    Seen in 1 report
  34. The title padding uses a bounded copy with the input length instead of the destination size.

    Seen in 1 report
  35. The token scan loop only stops at whitespace so a line with no whitespace runs past the buffer and writes a terminator out of bounds.

    Seen in 1 report
  36. The tooltip removal cleared the owner pointer but not the cached user-data pointer, leaving it dangling after the platform tooltip struct was freed.

    Seen in 1 report
  37. The Torque rewrites of the fixed-array allocation builtins dropped the maximum length bounds check the original assembly version performed.

    Seen in 1 report
  38. The total length is computed as size times count without checking for integer overflow before allocation.

    Seen in 1 report
  39. The total length was computed as the delimiter length times the element count minus one plus the element lengths, with no overflow check before allocation.

    Seen in 1 report
  40. The total size is validated only for the first fragment; later fragments trust the size field from the packet header.

    Seen in 1 report
  41. The touch event handler does not check whether the widget was destroyed during synchronous event dispatch.

    Seen in 1 report
  42. The trailer ID string is decoded into a fixed-size heap buffer with no length check.

    Seen in 1 report
  43. The transfer-shrink copy path allocated the destination uninitialised and copied only the prefix, while the resize growth path assumed the tail was already zeroed.

    Seen in 1 report
  44. The translate agent does not check whether it was destroyed after returning from synchronous JavaScript execution.

    Seen in 1 report
  45. The tree is not reset after a failed unserialize, so a duplicate node ID insertion returns a dangling pointer.

    Seen in 1 report
  46. The trustlet passes caller-supplied source pointer, destination pointer and length straight to memcpy instead of copying a fixed error code.

    Seen in 1 report
  47. The two gamma values were not checked to have the same sign, causing an integer overflow and out-of-bounds write.

    Seen in 1 report
  48. The two metadata parsing passes disagreed: the first skipped reserving a slot but the second still advanced the cursor, so later chunks wrote into an out-of-bounds slot.

    Seen in 1 report
  49. The type check in the division workaround transform matched only scalar types, so vector division and modulo were emitted without the workaround.

    Seen in 1 report
  50. The typed optimisation reducer creates a merge snapshot containing an uninhabited type, so an earlier fix did not cover every path.

    Seen in 1 report