...
| Code Block | ||
|---|---|---|
| ||
int result = 0; for(int i = 0; i < 4; i++) result = ((result << 8) | (b[i] & 0xff)); |
Risk Assessment
Failing to consider integer promotions when dealing with floating point and integer operands can result in loss of precision.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
EXP08- J | low | probable | medium | P4 | L3 |
Automated Detection
TODO
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
References
| Wiki Markup |
|---|
\[[JLS 05|AA. Java References#JLS 05]\] 4.2.2 "Integer Operations" and 5.6 "Numeric Promotions" \[[Findbugs 08|AA. Java References#Findbugs 08]\] "BIT: Bitwise OR of signed byte value" |
...