Question: Stack buffer overflow bugs are caused when a program writes more data to a buffer located on the stack than what is actually allocated for

Stack buffer overflow bugs are caused when a program writes more data to a buffer
located on the stack than what is actually allocated for that buffer. Study the
following C code and draw program stack in foo() with various inputs:
i. before data is copied
ii. "Security" is provided as command line argument
iii. AAAAAAAAAAAAAAAAAAAA \ x0A \ xAF x D8\ x77 is provided as
command line argument.
iv. What does \ x OA \ xAF \ xD 8\ x77 indicates? What happens when EIP is
filled with this address?
#include
void foo (char *bar)
char c[16];
strcpy(c, bar);
}
int main (int argc, char **argv)
{
foo(argv[1]);

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!