Question: For the following program, where are the stack frames of strcpy ( ) and fillBuffer ( ) located within memory ( RAM ) with respect

For the following program, where are the stack frames of strcpy () and fillBuffer () located within memory (RAM) with respect to the location of the stack frame of main()? Above, below, same position, unknown? Explain why.
#include
2 #include
3 #include
4
5 int fillBuffer(char *str){
6 charbuffer[100];
7 strcpy(buffer,str);/* BufferOverflow */
8 return1;
9}
10
11 int main(int argc, char **argv){
12 charstr[400];
13 FILE *badfile;
14 badfile=fopen("badfile","r");
15 fread(str,sizeof(char),300,badfile);
16 fillBuffer(str);
17 printf("ReturnedProperly
");
18 return1;
19}

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 Databases Questions!