CWE-253
Incorrect Check of Function Return Value
AI Translation Available
The product incorrectly checks a return value from a function, which prevents it from detecting errors or exceptional conditions.
Status
incomplete
Abstraction
base
Likelihood
low
Affected Platforms
Extended Description
AI Translation
Important and common functions will return some value about the success of its actions. This will alert the program whether or not to handle any errors caused by that function.
Technical Details
AI Translation
Common Consequences
availability
integrity
Impacts
unexpected state
dos: crash, exit, or restart
Detection Methods
automated static analysis
Potential Mitigations
Phases:
architecture and design
implementation
Descriptions:
•
Properly check all functions which return a value.
•
Use a language or compiler that uses exceptions and requires the catching of those exceptions.
•
When designing any function make sure you return a value or throw an exception in case of an error.