Question: 9 . Rewrite the two functions shown below so they are no longer vulnerable to a buffer overflow attack. Don t use any safe libraries
Rewrite the two functions shown below so they are no longer vulnerable to a buffer overflow attack. Dont use any safe libraries in your solution.
int copybuf char to int pos char from int len
int i; for i ; i len ; i
to pos from i ;
pos ;
return pos ;
short readchunk FILE fil char to
short len ;
fread & len fil ;
fread to len fil ;
return len ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
