A buffer overflow occurs when a program attempts to write data
to a buffer, but exceeds the boundaries of the buffer, similar to
Java's "Array Out of Bounds Exception." This could happen with
poorly written code that fails to check for the end of the buffer,
or it could be exploited maliciously. One exploitative example
would be a stack buffer overflow, in which data is copied to a
local variable on the stack. But if the data is larger than the
local variable can contain, the extra data will "spill over" onto
nearby memory. This would allow one to overwrite data that was not
intended to be altered.