...
Code Block | ||
---|---|---|
| ||
public Node updateNode(int id, int newValue) throws IdNotFoundException { Node current = root; while(current != null){ if(current.getId() == id){ current.setValue(newValue); return current; } current = current.next; } throw new NodeNotFoundException(); } |
...
Applicability
Failure to provide appropriate feedback through return values, error codes, and exceptions can lead to inconsistent object state and unexpected program behavior.
Guideline | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MET54-JG | medium | probable | medium | P8 | L2 |
Related Guidelines
C Secure Coding Standard: ERR02-C. Avoid in-band error indicators
C++ Secure Coding Standard: ERR02-CPP. Avoid in-band error indicators
Bibliography
[Ware 2008]
[MITRE 2009] CWE ID 393, "Return of Wrong Status Code," and CWE ID 389, "Error Conditions, Return Values, Status Codes"
...