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 701 to 750 of 976
  1. Improve bounds checking before reading memory.

    Seen in 1 report
  2. Improve bounds checking in the USB handling code.

    Seen in 1 report
  3. Improve input validation to prevent integer overflow when processing 3D models.

    Seen in 1 report
  4. Improved input validation for the out-of-bounds read.

    Seen in 1 report
  5. Improved memory management for the use-after-free.

    Seen in 1 report
  6. Include alignment padding when calculating the required buffer size before copying.

    Seen in 1 report
  7. Include all backend-specific size fields in cache keys so entries cannot alias.

    Seen in 1 report
  8. Include the negative-zero case in the typer for maths builtins so the comparison is not folded to a constant.

    Seen in 1 report
  9. Include the size of each operation when calculating the response buffer size.

    Seen in 1 report
  10. Include the texture resource type in the staging texture cache check.

    Seen in 1 report
  11. Increment the module script reference count when storing it in a function slot.

    Seen in 1 report
  12. Increment the reference count when assigning a raw pointer so error paths do not free it twice.

    Seen in 1 report
  13. Initialise and validate every element of the format array when the format line is empty or invalid.

    Seen in 1 report
  14. Initialise the dynamic buffer before the early-return check so the error path does not free an uninitialised pointer.

    Seen in 1 report
  15. Initialise the format pointer before the conditional branches.

    Seen in 1 report
  16. Initialise the full decoder state in constructors rather than relying on the caller.

    Seen in 1 report
  17. Initialise the read count before the stream read and handle the closed-stream case.

    Seen in 1 report
  18. Initialise the residue pointer before it can be used.

    Seen in 1 report
  19. Invalidate an annotation object after destruction so a second destroy call cannot operate on freed memory.

    Seen in 1 report
  20. Invalidate other server-side sessions when the password changes.

    Seen in 1 report
  21. Invalidate the certificate stats cache when a new transport name appears, and check the lookup result in release builds.

    Seen in 1 report
  22. Invalidate the Java-side pointer when the native object is deleted, and disable interaction during dismissal animations.

    Seen in 1 report
  23. Keep cache names in a single encoding so distinct names cannot alias.

    Seen in 1 report
  24. Keep duplicate-ID checks in release builds and use a wider or checked counter.

    Seen in 1 report
  25. Keep the context stack consistent around method_missing so the garbage collector sees valid pointers.

    Seen in 1 report
  26. Keep the global context alive until all dependent objects are gone.

    Seen in 1 report
  27. Keep the JavaScript engine runtime consistent when a binding throws during nested execution.

    Seen in 1 report
  28. Keep the mapping alive for as long as asynchronous code may read the pointer.

    Seen in 1 report
  29. Keep the page pinned while cached page-object handles are still held.

    Seen in 1 report
  30. Keep the string buffer alive while building an error message across nested allocations.

    Seen in 1 report
  31. Keep the text field object alive while a handler may still reference it.

    Seen in 1 report
  32. Keep typed-array backing stores pinned across direct native calls.

    Seen in 1 report
  33. Leave space for the subsequent concatenation when copying the token into the fixed buffer.

    Seen in 1 report
  34. Limit the locale length before passing it to ICU, and check the length before copying into the stack buffer.

    Seen in 1 report
  35. Limit the read size passed to the underlying stream to the caller's requested count.

    Seen in 1 report
  36. Make the deoptimizer traverse all Wasm stacks including those used by JSPI during lazy deoptimisation.

    Seen in 1 report
  37. Move image parsing out of the unsandboxed browser process or use a memory-safe parser.

    Seen in 1 report
  38. Null the pointer after freeing an object so later checks cannot be bypassed.

    Seen in 1 report
  39. Null the root popup menu pointer after freeing it and guard against re-entry during teardown.

    Seen in 1 report
  40. Null-terminate file data read into fixed buffers before passing it to string functions.

    Seen in 1 report
  41. Null-terminate private-key blobs before passing them to the key parser, matching the certificate and CA paths.

    Seen in 1 report
  42. Pass device-supplied strings as arguments to the format function rather than as the format string.

    Seen in 1 report
  43. Pass the actual output buffer size to the app data copy routine rather than a larger value.

    Seen in 1 report
  44. Pass the captured length rather than the on-wire length to the Ethernet printer.

    Seen in 1 report
  45. Pass the destination buffer size as the copy limit rather than the token length.

    Seen in 1 report
  46. Pass the user-supplied message as an argument to the error function rather than as the format string.

    Seen in 1 report
  47. Patch the shipped Ruby and apply the vendor advisories for the regex compiler bugs.

    Seen in 1 report
  48. Perform overflow checks on unsigned values so the compiler cannot remove them as undefined behaviour.

    Seen in 1 report