Buffer overflows and defences

Writing past the end of a stack buffer can overwrite the return address, and stack canaries, non-executable stacks and randomised addresses each block a different step of the attack.

From Computer systems, a programmer's view.