github / github/codeql

Java: FP in java/integer-multiplication-cast-to-long when using Long.BYTES

未關閉
#1,060 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
false-positive Java
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

See: https://discuss.lgtm.com/t/java-false-positives/1787/2

Example: https://lgtm.com/projects/g/apache/accumulo/snapshot/dist-1984940991-1551192209962/files/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java?sort=name&dir=ASC&mode=heatmap#xc3783b1655fd55ea:1

Final fields that are well-known, and for which we don't have the source code (e.g. `Long.BYTES`) are not considered `ConstantIntegerExpr` in `RangeUtils.qll`, so we incorrectly flag some multiplications as potential overflows.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。