Question: Question 1 : Explain the effect on the stack as the following code executes. Be sure to communicate what is happening and what will happen

Question 1: Explain the effect on the stack as the following code executes. Be
sure to communicate what is happening and what will happen when the strcpy
occurs. Use the following C code to depict the stack/heap like the slides 15 in
the buffer overflow teaching materials. [12.5 point]
int main ()//think of main like P
{
int returnedvalue.
/* In C, a function can return values */
/* Now you are passing a string into buffered */
/* the function buffered returns a value */
returnedvalue = buffered ("12345678910");
/* think of bof as Q; do not forget your parameters */
}
int buffered (char *str)
{
char mybuffer [10];
strcpy (mybuffer, str);
return 1;
}
Answer:
Question 1 : Explain the effect on the stack as

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!