Question: this program needs to be corrected to reject any input that contains formated output character. use terminal 1 #include 2 #include 3 #include 5 #define

 this program needs to be corrected to reject any input that
this program needs to be corrected to reject any input that contains formated output character.
use terminal
contains formated output character. use terminal 1 #include 2 #include 3 #include

1 #include 2 #include 3 #include 5 #define BUFFER_LENGTH 512 6 7 /* 8 * Week 3 Lab 2 * This program allows for input of formatted output * characters on the command line (such as *x and 4s), * and is therefore vulnerable to a formatted output * exploit. int main (int argc, char margv) { char buffer(BUFFER_LENGTH - 1] = {0}; if (argc BUFFER_LENGTH) { printf ("Buffer length too long. "); return -1; This program needs to be corrected to reject any * input that contains formatted output characters. snprintf(buffer, sizeof(buffer), argv(11) buffer(BUFFER_LENGTH 11. '\'; printf("You entered is. ", buffer) return @; } [ File Actions Edit View Help L$ ./week3lab -1 You entered -1. (rob kali)-[-/Desktop/rj/week3] ./week3lab Invalid number of arguments. (rob kali)-[-/Desktop/rj/week3] ./week3lab 1 You entered 1. [ (rob kali)-(-/Desktop/rj/week3] ./week3lab 11000 You entered 11000. Home (rob kali)-(-/Desktop/rj/week3] ./week3labs You entered s. I (rob kali)-[-/Desktop/rj/week3] ./week3lab sewwr You entered sewwr

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!