Many of the most serious attacks in history used one kind of programming mistake: writing more data into memory than there was room for. To see why that is so dangerous, you need a simple picture of how a running program uses memory. No programming is needed.
Memory is numbered boxes
A computer’s working memory is a very long row of boxes, each holding one byte (enough for one letter) and each with its own number, called its address. A running program keeps everything it is working on in these boxes: the text you typed, numbers it is counting, and notes to itself about what to do next. The same boxes can hold a letter, part of a number or an instruction; what they mean depends on how the program reads them.
The stack and the return slip
memory set aside for greet
A program keeps its working data in memory: a long row of numbered boxes, each holding one byte. Here a small part of a program, called greet, is about to ask for your name.
Why this matters
On the stack, a buffer sits right next to other important boxes, including the return slip. Nothing in the boxes themselves stops one from spilling into the next. Whether a program stays within its boxes depends on the programmer, and on protections the next lessons describe.
BUGS-1 counts as completed once you step through the figure to its last step.