mirror of
https://github.com/github/codeql.git
synced 2026-01-30 06:42:57 +01:00
Do not flow taint through remainder expressions
If the tainted operand is the first operand then it is being bounded above by the remainder expression. If it is the second operand then
This commit is contained in:
@@ -175,7 +175,7 @@ module AllocationSizeOverflow {
|
||||
|
||||
/**
|
||||
* Holds if the value of `pred` can flow into `succ` in one step, either through a call to `len`
|
||||
* or through an arithmetic operation.
|
||||
* or through an arithmetic operation (other than remainder).
|
||||
*/
|
||||
predicate additionalStep(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
exists(DataFlow::CallNode c |
|
||||
@@ -184,7 +184,8 @@ module AllocationSizeOverflow {
|
||||
succ = c
|
||||
)
|
||||
or
|
||||
succ.asExpr().(ArithmeticExpr).getAnOperand() = pred.asExpr()
|
||||
succ.asExpr().(ArithmeticExpr).getAnOperand() = pred.asExpr() and
|
||||
not succ.asExpr() instanceof RemExpr
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user