mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
C++: Only recognize signed integers as sinks in 'cpp/uncontrolled-arithmetic' in the case of overflow.
This commit is contained in:
@@ -82,8 +82,11 @@ predicate missingGuard(VariableAccess va, string effect) {
|
||||
op.getUnspecifiedType().(IntegralType).isUnsigned() and
|
||||
not op instanceof MulExpr
|
||||
or
|
||||
// overflow
|
||||
missingGuardAgainstOverflow(op, va) and effect = "overflow"
|
||||
// overflow - only report signed integer overflow since unsigned overflow
|
||||
// is well-defined.
|
||||
op.getUnspecifiedType().(IntegralType).isSigned() and
|
||||
missingGuardAgainstOverflow(op, va) and
|
||||
effect = "overflow"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user