Explain a buffer overflow attack?

Buffer overflow attack is an attack that takes advantage of a process that attempts to write more data to a fixed-length memory block.

A buffer overflow (or buffer overrun) occurs when the volume of data exceeds the storage capacity of the memory buffer. If the transaction overwrites executable code, it can cause the program to behave unpredictably and generate incorrect results, memory access errors, or crashes.
A buffer overflow, or buffer overrun, occurs when more data is put into a fixed-length buffer than the buffer can handle. This overflow usually results in a system crash, but it also creates the opportunity for an attacker to run arbitrary code or manipulate the coding errors to prompt malicious actions.