This preview shows page 1. Sign up to view the full content.
Unformatted text preview: OF-BOUNDS MEMORY REFERENCES AND BUFFER OVERFLOW 167 The general scheme is to set breakpoints near points of interest in the program. These can be set to just after the entry of a function, or at a program address. When one of the breakpoints is hit during program execution, the program will halt and return control to the user. From a breakpoint, we can examine different registers and memory locations in various formats. We can also single-step the program, running just a few instructions at a time, or we can proceed to the next breakpoint. As our examples suggests, GDB has an obscure command syntax, but the online help information (invoked within GDB with the help command) overcomes this shortcoming. 3.13 Out-of-Bounds Memory References and Buffer Overﬂow
We have seen that C does not perform any bounds checking for array references, and that local variables are stored on the stack along with state information such as register values and return pointers. This combination can lead to serious program errors, where the...
View Full Document
- Spring '10
- The American