github / github/codeql

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

オープン
#1,060 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
false-positive Java
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。