Skip to content

Glossary

Memory safety

The property that a program only accesses memory within the bounds and lifetime of valid objects, ruling out overflows, use-after-free and double free.

Memory safety is the guarantee that every memory access stays within the bounds of a valid object and within that object's lifetime. It rules out spatial errors (buffer overflows, out-of-bounds reads) and temporal errors (use-after-free, double free, use of uninitialised memory). C and C++ leave these guarantees to the programmer; languages such as Rust, Go, Java, C# and Swift enforce them through compile-time checks, runtime bounds checks and automatic memory management.

Several large vendors report that memory-safety issues make up the majority of their serious security bugs, which is why governments and industry now encourage memory-safe roadmaps. See memory-safe languages.