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 

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!