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
          {
              /* ... */
          }
      }
  }

Security training

Application security training materials provided by Secure Code Warrior.