Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Demonstrate along with brief explanation of at least two protections or mitigations against the buffer and stack overflow exploits. Use diagrams and screenshots where necessary
Demonstrate along with brief explanation of at least two protections or mitigations against the buffer and stack overflow exploits. Use diagrams and screenshots where necessary to help explain the protections and mitigations against these exploits. [14] #include #include #include #include #define MAX_NAME_SIZE 256 void func1(void) { int number = 0; // overflow target char buffer[16]; // to hold the player's name printf("Please enter your name: "); fgets(buffer, MAX_NAME_SIZE, stdin); // input from 'Standard In' printf("buffer address: %x ", (unsigned int)buffer); printf("buffer address: %x ", (unsigned int)&number); printf("Welcome "); printf(buffer); printf("The number is %d ", number); return; } void func2(void) { printf("This function never gets called! "); exit(-1); } int main(void) { // Program starts here. char some_space[80]; printf("buffer address: %x ", (unsigned int)some_space); func1(); return 0; }
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