CS.CONSTCOND.IF
The condition of an 'if' statement is always true or always false.
Example 1
Copy
class Thing {
void DoAction() {
if (sizeof(char) < 2) // defect - the condition is constant
{
/* ... */
}
}
}
External guidance
Security training
Application security training materials provided by Secure Code Warrior.