...
Code Block | ||
---|---|---|
| ||
for (i = 1; i <= Integer.MAX_VALUE - 2; i += 2) { // ... } |
...
Applicability
Testing for exact values to terminate a loop may result in infinite loops and denial of service.
...
Rule
...
Severity
...
...
Remediation Cost
...
Priority
...
Level
...
MSC54-JG
...
low
...
unlikely
...
low
...
P3
...
L3
Related Guidelines
...
...
MSC21-CPP. Use inequality to terminate a loop whose counter changes by more than one | |
CWE-835, "Loop with Unreachable Exit Condition ('Infinite Loop')" | |
| CWE-834, "Excessive Iteration" |
Bibliography
...