The code does not have a default case in an expression with multiple conditions, such as a switch statement.
If a multiple-condition expression (such as a switch in C) omits the default case but does not consider or handle all possible values that could occur, then this might lead to complex logical errors and resultant weaknesses. Because of this, further decisions are made based on poor information, and cascading failure results. This cascading failure may result in any number of security issues, and constitutes a significant failure in the system.
Impact: Varies by ContextAlter Execution Logic
Depending on the logical circumstances involved, any consequences may result: e.g., issues of confidentiality, authentication, authorization, availability, integrity, accountability, or non-repudiation.
c
//Break never reached because of exit()* break; case PASSED: ``` printf("Security check passed.\n"); break; }
cc
//Break never reached because of exit()* break; case PASSED: ``` printf("Security check passed.\n"); break; default: printf("Unknown error (%d), exiting...\n",result); exit(-1); }
javajavapythonpythonjavascriptjavascriptverilogverilog
default: state = 2'h0;** endcase