Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 92d81ed

Browse files
committed
Revert "C++: Remove the problematic taint tracking rule. It seems like we get the flows from dataflow already now."
This reverts commit 78b24b7.
1 parent 0b97a4a commit 92d81ed

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ private predicate instructionTaintStep(Instruction i1, Instruction i2) {
257257
i2.(ChiInstruction).getPartial() = i1.(WriteSideEffectInstruction) and
258258
not i2.isResultConflated()
259259
or
260+
// Flow from an element to an array or union that contains it.
261+
i2.(ChiInstruction).getPartial() = i1 and
262+
not i2.isResultConflated() and
263+
exists(Type t | i2.getResultLanguageType().hasType(t, false) |
264+
t instanceof Union
265+
or
266+
t instanceof ArrayType
267+
)
268+
or
260269
exists(BinaryInstruction bin |
261270
bin = i2 and
262271
predictableInstruction(i2.getAnOperand().getDef()) and

0 commit comments

Comments
 (0)