Skip to content

Commit d3f2d81

Browse files
authored
Merge pull request github#1967 from jbj/tainttracking-ir-2
C++: DefaultTaintTracking flow from a to a[i]
2 parents 9c6a0ff + 29c9348 commit d3f2d81

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cpp/ql/src/semmle/code/cpp/ir/dataflow/DefaultTaintTracking.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ private predicate instructionTaintStep(Instruction i1, Instruction i2) {
9090
predictableInstruction(i2.getAnOperand().getDef()) and
9191
i1 = i2.getAnOperand().getDef()
9292
)
93-
// TODO: Check that we have flow from `a` to `a[i]`. It may work for constant
94-
// `i` because there is flow through `predictable` `BinaryInstruction` and
95-
// through `LoadInstruction`.
96-
//
93+
or
94+
// This is part of the translation of `a[i]`, where we want taint to flow
95+
// from `a`.
96+
i2.(PointerAddInstruction).getLeft() = i1
9797
// TODO: Flow from argument to return of known functions: Port missing parts
9898
// of `returnArgument` to the `interfaces.Taint` and `interfaces.DataFlow`
9999
// libraries.

0 commit comments

Comments
 (0)