Question: The following is a flawed login program in C. Identify the error and how to fix it. I need this problem done for one of

"The following is a flawed login program in C. Identify the error and how to fix it."

I need this problem done for one of my classes please! Anything will help."The following is a flawed login program in C. Identify the error

7- (12 points) The following is a flawed login program in C. void login0f char password[ 100]; read(0, password, 100); /read password from keyboard if (verify(password) == false) exit(1); // error, and exit login // password is valid and continue bool verify(char* p) ( char pwd[8] = "secret!". // unknown to attacker char buf[8]; strcpy(buf, p) for (int 1-0; pwd[i] != '\0'; i++) if (buf[i] != pwd i]) return false; // verify the password return true

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!