A memory-safety defect is a programming error that mishandles memory, such as reading or writing outside an allocated buffer, using memory after it has been freed, or freeing it more than once. It can cause crashes or data corruption and, in some cases, allow an attacker to execute code or gain control of a process.
In cyber attacks, crafted input may trigger a defect in a network service, browser, or other software that processes untrusted data. Defenses include bounds and overflow checks, safer programming languages and libraries, input validation, and memory-protection features. Operating-system hardening can reduce the impact if a defect is exploited, while updates repair the underlying flaw.


