mirror of
https://github.com/github/codeql.git
synced 2025-12-19 10:23:15 +01:00
12 lines
374 B
Plaintext
12 lines
374 B
Plaintext
import cpp
|
|
|
|
predicate isSmall(Expr e) { e.getType().getSize() < 4 }
|
|
|
|
from AddExpr a, Variable v, RelationalOperation cmp
|
|
where
|
|
a.getAnOperand() = v.getAnAccess() and
|
|
cmp.getAnOperand() = a and
|
|
cmp.getAnOperand() = v.getAnAccess() and
|
|
forall(Expr op | op = a.getAnOperand() | isSmall(op)) and
|
|
not isSmall(a.getExplicitlyConverted())
|
|
select cmp, "Bad overflow check" |