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 751 to 800 of 976
  1. Perform the beg plus len bounds check in a way that cannot overflow.

    Seen in 1 report
  2. Perform the bounds check before writing to the array.

    Seen in 1 report
  3. Perform the FAT sector count times sector size calculation in a width that cannot overflow, or check the result before allocating.

    Seen in 1 report
  4. Perform the length calculation without a 32-bit multiply that can overflow, or reject inputs that would overflow.

    Seen in 1 report
  5. Perform the maximum message size check with unsigned or overflow-checked arithmetic.

    Seen in 1 report
  6. Perform the uniform packing limit sum with overflow-checked arithmetic.

    Seen in 1 report
  7. Pin or lock the cache entry across the size query and the data read.

    Seen in 1 report
  8. Prevent stacking ecryptfs on procfs and add guard pages to kernel stacks.

    Seen in 1 report
  9. Propagate the procs restriction object to nested objects during SkPicture deserialisation.

    Seen in 1 report
  10. Properly validate and handle malformed networking packets received over the air.

    Seen in 1 report
  11. Protect map and unmap operations with the same lock so the backing page cannot be freed mid-operation.

    Seen in 1 report
  12. Protect processing methods with the same lock used when clearing handlers during teardown.

    Seen in 1 report
  13. Publish a DMARC record so receivers can reject or quarantine unauthenticated mail.

    Seen in 1 report
  14. Publish technical detail with security advisories so hunters do not have to reverse patches.

    Seen in 1 report
  15. Randomise memory layout correctly so ASLR is effective.

    Seen in 1 report
  16. Rate limit submissions on the contact form and do not send mail to arbitrary addresses.

    Seen in 1 report
  17. Re-check for infinity after the multiplication and guard the integer cast.

    Seen in 1 report
  18. Re-check that the request list is non-empty before indexing it in the delayed prompt callback.

    Seen in 1 report
  19. Re-check the anonymous content node after layout runs script and cycle collection.

    Seen in 1 report
  20. Re-check the condition pointer after navigation commit steps that can reentrantly erase it.

    Seen in 1 report
  21. Re-validate the inspector pointer after JavaScript callbacks.

    Seen in 1 report
  22. Read the annotation page number once under a lock and use the cached value for both the check and the use.

    Seen in 1 report
  23. Read the buffer size after the GL layer updates it and clear stale dirty flags on recycled buffers.

    Seen in 1 report
  24. Reallocate packet buffers when a negotiated block size changes.

    Seen in 1 report
  25. Recheck the map kind after updating a deprecated map instead of assuming it stays a fast map.

    Seen in 1 report
  26. Reduce the recorded length when advancing the data pointer past skipped bytes.

    Seen in 1 report
  27. Refresh all cached buffer pointers, not only those for attributes active in the current shader.

    Seen in 1 report
  28. Refresh cached pointers in the upload progress callback after the hash table is re-decoded.

    Seen in 1 report
  29. Reject a second Init after the first has resolved and release the existing decoder session before replacing its pointer.

    Seen in 1 report
  30. Reject all negative index values and use unsigned comparisons in the numbering loop.

    Seen in 1 report
  31. Reject batch requests where a later operation references an anonymous set deleted earlier in the same batch.

    Seen in 1 report
  32. Reject dictionary size resets to zero after the context has been set up.

    Seen in 1 report
  33. Reject faces with out-of-range or negative vertex indices rather than skipping them.

    Seen in 1 report
  34. Reject JPEG2000 SIZ markers that declare zero components before allocating.

    Seen in 1 report
  35. Reject mixed advanced and standard blend equations across enabled draw buffers.

    Seen in 1 report
  36. Reject negative binding offsets and keep offsets unsigned through the decoder.

    Seen in 1 report
  37. Reject non-finite floating-point values during deserialisation before they are used as map keys.

    Seen in 1 report
  38. Reject non-finite values in the k-rate audio parameter path.

    Seen in 1 report
  39. Reject removal and cleanup of the internal admin easy handle.

    Seen in 1 report
  40. Reject superblocks where block addresses and segment counts are all zero so areas cannot overlap.

    Seen in 1 report
  41. Reject variable definitions that appear after the end-of-definitions marker.

    Seen in 1 report
  42. Reload the instance cache when any memory is grown, not only when memory zero can grow.

    Seen in 1 report
  43. Remove the dangling reference so freed memory is not used again.

    Seen in 1 report
  44. Remove the pure annotation from getters that flush layout or dispatch events.

    Seen in 1 report
  45. Remove the stale pointer from the document dictionary when a reference object is freed.

    Seen in 1 report
  46. Remove the vulnerable code in IOKit.

    Seen in 1 report
  47. Replace unchecked strcpy of launch arguments with bounded copying.

    Seen in 1 report
  48. Require that all expected fields were parsed before treating the parse as successful.

    Seen in 1 report
  49. Reserve one more slot than the index that will be accessed in the bitmap vector.

    Seen in 1 report