Skip to content

Commit c362d2f

Browse files
committed
Rust: Address PR feedback
1 parent 53ee098 commit c362d2f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

rust/ql/lib/codeql/rust/dataflow/internal/TaintTrackingImpl.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ module RustTaintTracking implements InputSig<Location, RustDataFlow> {
6969
s instanceof Builtins::NumericType or
7070
s instanceof Builtins::Bool or
7171
s instanceof Builtins::Char
72-
)
72+
) and
73+
not t.(Type::EnumType).getEnum().isFieldless()
7374
) and
74-
not excludedTaintStepContent(c) and
75-
not TypeInference::inferType(succ.asExpr()).(Type::EnumType).getEnum().isFieldless()
75+
not excludedTaintStepContent(c)
7676
)
7777
or
78-
// Let all read steps (including those from flow summaries and those that
78+
// In addition to the above, for element and reference content we let
79+
// _all_ read steps (including those from flow summaries and those that
7980
// result in small primitive types) give rise to taint steps.
8081
exists(SingletonContentSet cs | RustDataFlow::readStep(pred, cs, succ) |
8182
cs.getContent() instanceof ElementContent

0 commit comments

Comments
 (0)