Memory Safety

Work in progress. This note is still being written and incomplete.

1 min read Last updated Tue Aug 18 2026 07:15:37 GMT+0000 (Coordinated Universal Time)

A program execution is memory safe iff none of the following occur:

  • Access errors
  • Buffer overflow or over-read
  • Invalid pointer
  • Race condition
  • Use after free
  • Uninitialized variable or pointer access
  • Null pointer access
  • Memory leak
  • Stack or heap overflow
  • Invalid free
  • Unwanted aliasing

Spatial and Temporal Violations

A spatial violation is a memory access outside an object’s bounds.

  • Buffer overflow
  • Out-of-bounds read
  • Null pointer dereference

A temporal violation is a memory access referring to an invalid object.

  • Use after free
  • Double free
  • Use of uninitialized memory

Overflows, covered in buffer overflow basics, heap overflow, and integer overflow, are the most common form of spatial violation.

Was this helpful?