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 1,201 to 1,250 of 3,817
  1. A length check compared each character-string against the total record length but ignored the cumulative length of all strings plus separators and terminator.

    Seen in 1 report
  2. A length check macro does not validate that the length is non-negative and the return value of the bounded print is not checked.

    Seen in 1 report
  3. A length check was missing before reading the buffer in the whitespace check.

    Seen in 1 report
  4. A length field from the input is copied into a fixed-size stack buffer without checking that it fits.

    Seen in 1 report
  5. A length field from the NRW file was copied into a fixed-size heap buffer without verifying it fit.

    Seen in 1 report
  6. A length field from the tag header was used as the copy bound without checking it against the destination buffer size.

    Seen in 1 report
  7. A length field or data size from the file is copied into a fixed-size heap buffer without verifying it fits.

    Seen in 1 report
  8. A length field uses zero both for not supplied and for explicitly zero, so the code falls back to strlen.

    Seen in 1 report
  9. A length is declared signed but parsed as unsigned, so negative values bypass the check and move the string pointer backwards.

    Seen in 1 report
  10. A length is subtracted from a maximum without checking, causing an underflow and an overly large length.

    Seen in 1 report
  11. A length or count decremented below zero and wrapped to a large value.

    Seen in 1 report
  12. A length or count value from the request is not validated, causing an integer overflow in the buffer size calculation.

    Seen in 1 report
  13. A length or offset field in the file was trusted without checking it against the real buffer size.

    Seen in 1 report
  14. A length or size value from the MKV file was used without a bounds check before a heap write.

    Seen in 1 report
  15. A length plus one size calculation overflows when the length is the maximum unsigned 32-bit value, producing a tiny allocation.

    Seen in 1 report
  16. A length taken from the uploaded file is used in a copy into a fixed-size heap buffer without a bounds check.

    Seen in 1 report
  17. A length taken from untrusted input is used directly in a bounded copy without checking it fits the destination.

    Seen in 1 report
  18. A length value from the file is used directly as an index into a fixed-size stack buffer without bounds checking.

    Seen in 1 report
  19. A length variable is decremented without checking for zero, causing an integer underflow used as a size argument.

    Seen in 1 report
  20. A length variable is set to minus one when the timezone pointer equals the fraction pointer and is later treated as no length given, causing a string read past the buffer.

    Seen in 1 report
  21. A length variable was decremented without checking it was already zero, so it became negative.

    Seen in 1 report
  22. A length was decremented without checking for zero, causing an underflow.

    Seen in 1 report
  23. A length-append helper writes into a buffer without checking the new length fits.

    Seen in 1 report
  24. A lifetime bug in dead-block removal or an assembly helper uses a stack object after its scope ends.

    Seen in 1 report
  25. A lifetime or ownership error in the raw-frame conversion pipeline wrote into stale or freed memory.

    Seen in 1 report
  26. A lifetime ordering issue: the connection and display are destroyed before the screen that holds a proxy pointer to them.

    Seen in 1 report
  27. A live hash set of shadow instances was iterated without a snapshot and the modification check was compiled out in release builds.

    Seen in 1 report
  28. A local packet structure was used without being initialised, so garbage side-data fields were freed by the cleanup routine.

    Seen in 1 report
  29. A local service fails to validate user-supplied data, causing an out-of-bounds access.

    Seen in 1 report
  30. A local variable is not initialised before being passed to a stream read, and the closed-stream case is not handled.

    Seen in 1 report
  31. A locking object's destructor touches memory after the underlying object has been freed because lifetime is not managed during stop.

    Seen in 1 report
  32. A logic error and out-of-bounds access in fragment descriptor handling plus a copy-before-check loop allow a heap overflow.

    Seen in 1 report
  33. A logic flaw in the optimising compiler when compiling a class with a parent class and a new.target reference led to an out-of-bounds write.

    Seen in 1 report
  34. A logic mistake in DNS query buffer length calculation for an escaped trailing dot.

    Seen in 1 report
  35. A long value from the environment is cast to int without checking it fits, producing an oversized write.

    Seen in 1 report
  36. A lookup meant for the UI thread is called from the IO thread, guarded only by a debug assertion.

    Seen in 1 report
  37. A loop condition checked the byte value before verifying the pointer was within bounds.

    Seen in 1 report
  38. A loop counter is decremented each iteration without checking it becomes negative, so the loop runs indefinitely and writes past the buffer.

    Seen in 1 report
  39. A loop in the gradient colour-table generator did not check the write position against the fixed buffer size.

    Seen in 1 report
  40. A loop index is checked against the size of one table but then used to index a different table.

    Seen in 1 report
  41. A loop iterated the member container instead of a local copy, so erasing and reallocation during callbacks invalidated the iterators.

    Seen in 1 report
  42. A loop that frees the same pointer twice when an allocation fails after a successful iteration.

    Seen in 1 report
  43. A lowering drops the safe-integer check bit so a checked consumer receives an unchecked truncation.

    Seen in 1 report
  44. A manually managed reference was released by two unconditional release calls in separate shutdown paths with no flag to release only once.

    Seen in 1 report
  45. A map entry was erased using an iterator after a call that could synchronously destroy the socket and erase that same entry, invalidating the iterator.

    Seen in 1 report
  46. A map holds non-owning raw pointers and the cleanup callback takes the same lock as the open path, allowing a race.

    Seen in 1 report
  47. A map of raw pointers is read from a worker thread without a lock while the main thread deletes entries.

    Seen in 1 report
  48. A member flag was restored through a raw pointer held across a call that could synchronously destroy the owning object.

    Seen in 1 report
  49. A member observer list is iterated instead of a local copy, so shutdown during the loop frees it.

    Seen in 1 report
  50. A member was accessed by two threads without synchronisation and task ordering let the object be destroyed while in use.

    Seen in 1 report