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,451 to 3,500 of 3,817
  1. The return value of the key serialisation call is ignored, so a failure leaves caller-supplied buffers uninitialised or stale.

    Seen in 1 report
  2. 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
  3. 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
  4. The return value of the string reader is not checked before being passed to the tokeniser.

    Seen in 1 report
  5. 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
  6. The return value of the UUID conversion was not checked, so a pointer to static memory was freed on failure.

    Seen in 1 report
  7. The return value of the virtqueue chain fetch is not checked, so on failure an uninitialised iovec array is used.

    Seen in 1 report
  8. 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
  9. 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
  10. The rls-login handler copies user-supplied data into a fixed-length stack buffer without validating its length.

    Seen in 1 report
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. The RTSP server copies the Authorization header into a fixed-length stack buffer without checking its length.

    Seen in 1 report
  17. The RTSP server does not check the length of the username in the Authorization header before copying it into a fixed-length stack buffer.

    Seen in 1 report
  18. The rule removal function freed an object and then accessed it again.

    Seen in 1 report
  19. 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
  20. 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
  21. The same allocation released more than once.

    Seen in 1 report
  22. The same memory allocation is freed more than once.

    Seen in 1 report
  23. The same memory block is freed twice during cleanup after an HTTP proxy connection with a non-HTTP protocol.

    Seen in 1 report
  24. 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
  25. The same socket was added to a global list twice, corrupting the list and causing a double-free.

    Seen in 1 report
  26. The sample count calculation multiplied frames by channel count without an integer overflow check, so the allocation wrapped while the write did not.

    Seen in 1 report
  27. The scale argument was not checked to be non-negative, so a negative value corrupted internal state.

    Seen in 1 report
  28. The scheduler used a user-supplied MTU value in memory calculations without validating it against the allocated buffer size.

    Seen in 1 report
  29. The script load context was destroyed while a pending dynamic import still held a reference to it.

    Seen in 1 report
  30. 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
  31. The scroll-into-view event is not cancelled when the frame selection is destroyed, so it holds a reference to freed memory.

    Seen in 1 report
  32. 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
  33. 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.

    Seen in 1 report
  34. The second chroma QP index offset field was not range-checked against the spec range while its sibling field was.

    Seen in 1 report
  35. 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
  36. The sector size read from the file is not checked to be at least 4, so the offset calculation underflows.

    Seen in 1 report
  37. The SecurityManager could be reached and manipulated from within the same process.

    Seen in 1 report
  38. The selection listener keeps a reference to a document viewer destroyed when the iframe's document shell is torn down.

    Seen in 1 report
  39. 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
  40. 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
  41. The server accepted uploaded files without enforcing a maximum size before processing them.

    Seen in 1 report
  42. 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.

    Seen in 1 report
  43. 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
  44. The server enabled anonymous key exchange cipher suites that perform no server authentication.

    Seen in 1 report
  45. The server read a fixed size into a buffer at an offset without checking remaining space.

    Seen in 1 report
  46. 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.

    Seen in 1 report
  47. 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
  48. The server uses the NextCommand field as a length in HMAC calculations without validating it, causing an integer overflow.

    Seen in 1 report
  49. The service deserialises data from a location an ordinary local user can influence without validating what that data can construct.

    Seen in 1 report
  50. 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