github / github/codeql

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

Aperta
#1,060 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
false-positive Java
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.