Question
Buffer Overflow [40 points] Question 1: Draw and explain a function stack frame for the following C function similar to the slides 12-15 in the
Buffer Overflow [40 points] Question 1: Draw and explain a function stack frame for the following C function similar to the slides 12-15 in the teaching materials. [20 point]
main ()
{
int value;
value = bof (12345678910);
}
int bof (char *str)
{
char buffer [10];
strcpy (buffer, str);
return 1;
}
Answer: Question 2: Is this following code segment safe? Explain why or why not? [10 points]
int bof (char *str, int size) {
char *buffer = (char *) malloc (size);
strcpy (buffer, str);
return 1; }
Notes: malloc is a C library function that allocates space of a specific size
Question 3: Why does ASLR make buffer-overflow attack more difficult? [10 points]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started