Home / Vulnerability Database / C or C++ : Switch missing default
C/C++

C or C++ : Switch missing default

Classification

Overview

A switch statement missing default label.

The use of default label can aid in avioding mistakes and can be used for the following reasons:

  • Perform some action if the variable has unexpected value.
  • Handle default cases, while special ones are handled under case labels.
  • The one reading the code can crearly see that all cases are covered.
LOW

DerScanner Severity Score

Do you want to fix C or C++ : Switch missing default in your application?

See also

C/C++

C or C++ : Dead store

C/C++

C or C++ : Use after free

C/C++

C or C++ : va_list uninitialized