Skip to content

Commit fe37e3d

Browse files
committed
Rust: Address PR feedback
1 parent 273eb19 commit fe37e3d

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
@@ -57,13 +57,14 @@ module RustTaintTracking implements InputSig<Location, RustDataFlow> {
5757
s instanceof Builtins::NumericType or
5858
s instanceof Builtins::Bool or
5959
s instanceof Builtins::Char
60-
)
60+
) and
61+
not t.(Type::EnumType).getEnum().isFieldless()
6162
) and
62-
not excludedTaintStepContent(c) and
63-
not TypeInference::inferType(succ.asExpr()).(Type::EnumType).getEnum().isFieldless()
63+
not excludedTaintStepContent(c)
6464
)
6565
or
66-
// Let all read steps (including those from flow summaries and those that
66+
// In addition to the above, for element and reference content we let
67+
// _all_ read steps (including those from flow summaries and those that
6768
// result in small primitive types) give rise to taint steps.
6869
exists(SingletonContentSet cs | RustDataFlow::readStep(pred, cs, succ) |
6970
cs.getContent() instanceof ElementContent

0 commit comments

Comments
 (0)