Skip to content

In-depth lesson · Memory corruption

Typical fixes

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 101 to 150 of 976
  1. Validate lengths and sizes before copying or writing input into buffers.

    Seen in 8 reports
  2. Validate size calculations for underflow and overflow before allocating or indexing.

    Seen in 8 reports
  3. Validate size, offset and count fields against the actual buffer length before reading or writing.

    Seen in 8 reports
  4. Validate user-supplied pointer values before dereferencing them in driver drawing routines.

    Seen in 8 reports
  5. Add bounds checks before reading or writing based on file-supplied sizes.

    Seen in 7 reports
  6. Add improved input validation and bounds checks when parsing crafted files in Apple frameworks.

    Seen in 7 reports
  7. Apply improved bounds checking and memory lifetime handling in SMB, UDF, GPU and storage drivers.

    Seen in 7 reports
  8. Check a weak pointer for liveness after any callback that could destroy the object, and avoid relying on synchronous callbacks.

    Seen in 7 reports
  9. Check length, offset and element count fields against buffer bounds before indexing or reading.

    Seen in 7 reports
  10. Check size and offset arithmetic for overflow and underflow before allocating or indexing.

    Seen in 7 reports
  11. Check that an object still exists before dereferencing it, and clear pointers when freeing.

    Seen in 7 reports
  12. Check that an object still exists before using or freeing it, and initialise memory before accessing it.

    Seen in 7 reports
  13. Correct how kernel components handle objects in memory so crafted applications cannot corrupt kernel memory.

    Seen in 7 reports
  14. Correct how the component handles objects in memory so freed or out-of-range objects are not used.

    Seen in 7 reports
  15. Correct object handling in the scripting engine.

    Seen in 7 reports
  16. Improve input sanitisation and bounds checking in media parsers.

    Seen in 7 reports
  17. Improve validation, state handling and memory handling for crafted web content.

    Seen in 7 reports
  18. Improved input validation and bounds checking when parsing media files.

    Seen in 7 reports
  19. Initialise memory resources before use and do not let crafted input steer writes to uninitialised state.

    Seen in 7 reports
  20. Initialise resources before use and check bounds on all reads and writes.

    Seen in 7 reports
  21. Length-check user-supplied parameters before copying them into fixed-size buffers.

    Seen in 7 reports
  22. Prevent the same memory from being freed more than once.

    Seen in 7 reports
  23. Validate a value from the file before using it as a pointer, and check for null before dereferencing.

    Seen in 7 reports
  24. Validate image-supplied size and offset values against the destination buffer before computing write addresses and loop counts.

    Seen in 7 reports
  25. Validate lengths and offsets from the file against the destination buffer size before copying or reading.

    Seen in 7 reports
  26. Validate size, length and offset fields from the file against the actual buffer before copying or reading.

    Seen in 7 reports
  27. Validate that a value read from a file is of the expected type and is a valid pointer before it is used.

    Seen in 7 reports
  28. Validate the length of user-supplied data before copying it into a fixed-length buffer.

    Seen in 7 reports
  29. Validate the type and length of arguments before using them in the JavaScript API methods.

    Seen in 7 reports
  30. Bound the length of multipart values, boundaries, headers and bodies before copying them into fixed buffers.

    Seen in 6 reports
  31. Check arithmetic on untrusted sizes for overflow, underflow and truncation before using the result.

    Seen in 6 reports
  32. Check object types before use and do not trust type fields from input.

    Seen in 6 reports
  33. Check size calculations for overflow before allocating buffers.

    Seen in 6 reports
  34. Check that a Doc object still exists before performing operations on it.

    Seen in 6 reports
  35. Check that an object still exists before performing operations on it, and hold strong references where needed.

    Seen in 6 reports
  36. Check that an object still exists before using it and track lifetime with strong references rather than raw pointers.

    Seen in 6 reports
  37. Check that an object still exists before using it, and clear pointers when objects are freed or detached.

    Seen in 6 reports
  38. Check that an object still exists before using or freeing it, and track object lifetime across event handlers.

    Seen in 6 reports
  39. Check that length fields are within expected bounds before using them in arithmetic or memory operations.

    Seen in 6 reports
  40. Check the length of incoming data before copying it into fixed-size stack or heap buffers.

    Seen in 6 reports
  41. Correct how the driver or component handles objects in memory.

    Seen in 6 reports
  42. Improve input validation when parsing crafted files and messages.

    Seen in 6 reports
  43. Improved bounds checking and memory management in the SMB client.

    Seen in 6 reports
  44. Invalidate or reference-count objects when a document closes so later script access cannot reach freed memory.

    Seen in 6 reports
  45. Pass the remaining space rather than the full buffer size to each formatting call, and check lengths from files and network data against the destination buffer before copying.

    Seen in 6 reports
  46. Perform size calculations with overflow-checked arithmetic and validate counts against the actual data length before allocating.

    Seen in 6 reports
  47. Use weak pointers or liveness guards after any call that can synchronously destroy the object.

    Seen in 6 reports
  48. Validate every length read from a file against the destination buffer size before copying.

    Seen in 6 reports
  49. Validate file-supplied sizes, lengths and offsets against the allocated buffer before copying or reading.

    Seen in 6 reports
  50. Validate lengths and array indices from files before copying or indexing.

    Seen in 6 reports