This vulnerability occurs when a program misinterprets or improperly validates the return value from a function, causing it to miss critical error states or unexpected conditions.
Many critical functions, especially those dealing with system resources, memory, files, or network connections, communicate success or failure through their return values. A developer must correctly check these values to understand if the operation completed as expected or if an error occurred that requires handling, such as a failed memory allocation or a closed network socket. Failing to perform accurate checks often leads to the program continuing execution as if nothing is wrong, even when it's operating on invalid data, null pointers, or corrupted states. This creates a gap between the actual error and the program's awareness of it, allowing subsequent operations to fail silently or behave unpredictably, which can lead to crashes, data corruption, or security bypasses.
Impact: Unexpected StateDoS: Crash, Exit, or Restart
An unexpected return value could place the system in a state that could lead to a crash or other unintended behaviors.
Strategy: Language Selection
c
//should have checked if the call returned 0* }
Low