...
Failure to handle error codes or other values returned by functions can lead to incorrect program flow and violations of data integrity.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
EXP12-C | Medium | Unlikely | Medium | P4 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Astrée |
| error-information-unused-computed | Fully checked | ||||||
CodeSonar |
| LANG.FUNCS.IRV | Ignored return value | ||||||
Compass/ROSE |
| CHECKED_RETURN | Finds inconsistencies in how function call return values are handled. Coverity Prevent cannot discover all violations of this recommendation, so further verification is necessary | |||||||
Cppcheck |
| leakReturnValNotUsed, ignoredReturnValue | Return value of memory allocation function is not used. Ignored return value from function when configuration says it must be used. See the chapter "Library configuration" in the cppcheck manual | ||||||
| CC2.EXP12 | Fully implemented | |||||||
Klocwork |
|
LDRA tool suite |
| 382 S | Fully implemented | ||||||
Parasoft C/C++test |
|
|
| CODSTA-122_{a,b} | Fully implemented | |||||||
R2016b | Returned value of a sensitive function not checked | Sensitive functions called without checking for unexpected return values and errors | |||||||
PRQA QA-C |
| 3200 | Fully implemented | ||||||
RuleChecker |
| error-information-unused | Partially checked | ||||||
Splint |
|
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
SEI CERT C++ Coding Standard | VOID EXP12-CPP. Do not ignore values returned by functions or methods |
CERT Oracle Secure Coding Standard for Java | EXP00-J. Do not ignore values returned by methods |
ISO/IEC TR 24772:2013 | Passing Parameters and Return Values [CSJ] |
MITRE CWE | CWE-754, Improper check for unusual or exceptional conditions |
Bibliography
[ISO/IEC 9899:2011] | Subclause 6.8.3, "Expression and Null Statements" |
...
...