This class is again among the more common—but deadly!—memory-access bugs. They can be classified as different kinds of bugs:
- Write overflow: A bug where a write is attempted into a memory buffer after its last legally accessible location
- Write underflow: A write is attempted into a memory buffer before its first legally accessible location
- Read underflow: A read is attempted on a memory buffer before its first legally accessible location
- Read overflow: A read is attempted on a memory buffer after its first legally accessible location
Let's check these out via the source code of our membugs.c program.