Fact Checked

What Is a Buffer Overflow?

T.S. Adams
T.S. Adams

A buffer overflow occurs when a program is trying to write to a buffer and steps outside its boundaries, resulting in the program's writing information to memory that potentially belongs to another program. This violates the integrity of memory within the operating system, resulting in a serious error and potential crash for the executing program. The major danger of a buffer overflow comes from two major elements. First, the information written outside the buffer is ostensibly "lost," as the computer's memory map — its list of memory locations — cannot account for it. Second, a buffer overflow can accidentally overwrite information stored in memory for another program, effectively interfering with the execution of another program as well.

A "buffer" is a region of memory used as a temporary storage location while the computer is transferring information from one point to another. The most common use of a buffer is typically in video or audio playback, where the computer cues up an additional X seconds of footage or audio in memory, ensuring that playback will not be interrupted if something goes temporarily amiss on the system. A buffer exists only within a specific, predetermined location within the computer's memory, much like a country only exists within the boundary lines drawn on a map. Stepping outside these virtual "lines" results in problems not only for the program running, but for other programs on the system.

Woman doing a handstand with a computer
Woman doing a handstand with a computer

Essentially, the program has stepped outside its assigned jurisdiction and has invaded the space of another working program. Once this happens, the information written outside the buffer effectively falls off the computer's map; in other words, the system no longer has any way to retrieve it. Since the computer only "knows" to search for buffered information within the specific buffer space allocated in memory, it has no way to figure out where the overflowed information has gone.

In addition to this, a buffer overflow has the potential to disrupt other programs running on the computer. Imagine that the memory storage space on either side of the buffer has already been assigned to other running programs. Once the information in the buffer bleeds past its designed area, it will overwrite and corrupt any information already stored in those sections of memory. Therefore, a buffer overflow is a problem that can undermine the efficacy of an adjacent program as well as corrupting its own operation.

You might also Like

Discuss this Article

Post your comments
Forgot password?
    • Woman doing a handstand with a computer
      Woman doing a handstand with a computer