Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

1610. What is meant by a postaudit of an investment project?

Answered: 1 week ago