Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int PasswdProcess::ConversePasswd(....)
- {
- ....
- state = 0;
- while (state != 1)
- {
- line = readLine();
- if (line.isNull())
- {
- // No more input... OK
- return 0;
- }
- if (isPrompt(line, "password"))
- {
- // Uh oh, another prompt. Not good!
- kill(m_Pid, SIGKILL);
- waitForChild();
- return PasswordNotGood;
- }
- m_Error += line + '\n'; // Collect error message
- }
- ....
- }
- This suspicious code was found in KDE4 project by PVS-Studio static code analyzer.
- Warning message is:
- V654 The condition 'state != 1' of loop is always true. passwd.cpp 255
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment