Array overruns and buffer overflows occur when a memory access accidentally goes beyond the boundary of the allocated array or buffer.
These overreaching accesses cause some of the most damaging and hard to track defects. Not only do these faulty accesses constitute undefined
behavior, but they frequently introduce security vulnerabilities, too.
What is the potential impact?
Accessing memory that goes beyond the boundary of the allocated array or buffer results in undefined behavior.
For programs that exercise undefined behavior, the compiler is no longer bound by the language specification. The application may crash or, even
worse, the application may appear to execute correctly while losing data or producing incorrect results.
Out-of-bounds memory accesses cause some of the most damaging and hard-to-track defects. Unbounded memory accesses may also introduce severe
security vulnerabilities. In case a user of the program can control the contents of a buffer, for instance, a malicious attacker can use the buffer
overflow to overwrite critical data, leak secret or private information, execute arbitrary code, or gain unauthorized access to the system.