Question: Question 1 : Evaluate the following program written in C language. char key [ 8 ] = 1 1 2 2 ; char

Question 1: Evaluate the following program written in C language.
char key [8]="1122";
char name [8]= "secure";
char pwd [8];
gets(pwd);
prf(key);
prf(name);
prf(pwd);
prf(key+8);
a. What would be the output of above program if the entered password is 1010. Provide explanation for each line.
b. Identify the vulnerability in this code. Provide an input value that changes the value of key without changing the value of name.
c. How can we correct this code?
Question 1 : Evaluate the following program

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!