Question: Integer overflow is another overflow vulnerability. Consider the following C code, which illustrates an integer overflow. int copy something (char *buf, int len) {
Integer overflow is another overflow vulnerability. Consider the following C code, which illustrates an integer overflow. int copy something (char *buf, int len) { char kbuf [800] ; if (len sizeof(kbuf)) { return -1; } return memcpy(kbuf, buf, len); } (1) What is the potential problem with this code? Hint: The last argument to the func- tion memcpy is interpreted as an unsigned integer. (2) Explain how an integer overflow might be exploited by Trudy.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
