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.