Skip to content

Commit 3b59118

Browse files
committed
C++: remove partial flow from UnknownType
1 parent 1199ff9 commit 3b59118

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,14 @@ private predicate instructionTaintStep(Instruction i1, Instruction i2) {
199199
// Flow through pointer dereference
200200
i2.(LoadInstruction).getSourceAddress() = i1
201201
or
202-
// Flow through partial reads of arrays, unions, and pointer parameters
203-
// TODO: `UnknownType` includes *all* pointer parameters. We only want
204-
// array-like pointer parameters
202+
// Flow through partial reads of arrays and unions
205203
i2.(LoadInstruction).getSourceValueOperand().getAnyDef() = i1 and
206204
not i1.isResultConflated() and
207205
(
208206
i1.getResultType() instanceof ArrayType or
209-
i1.getResultType() instanceof UnknownType or
210207
i1.getResultType() instanceof Union
211-
)
212-
or
208+
)
209+
or
213210
// Unary instructions tend to preserve enough information in practice that we
214211
// want taint to flow through.
215212
// The exception is `FieldAddressInstruction`. Together with the rule for

0 commit comments

Comments
 (0)