CS.CONSTCOND.SWITCH

The condition of a 'switch' statement is constant.

Example 1

1  class Foo {
2      void Method() {
3          switch(3 + 2)   // defect - the condition is constant
4          {  
5              /* ... */
6          }
7      }
8  }

Security training

Application security training materials provided by Secure Code Warrior.