Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions