Skip to content

Commit faf69b8

Browse files
committed
Rust: Add sinks as barriers to prevent duplicate results.
1 parent bb50e9f commit faf69b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rust/ql/src/queries/security/CWE-798/HardcodedCryptographicValue.ql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ module HardcodedCryptographicValueConfig implements DataFlow::ConfigSig {
3939
// case like `[0, 0, 0, 0]`)
4040
isSource(node)
4141
}
42+
43+
predicate isBarrierOut(DataFlow::Node node) {
44+
// make sinks barriers so that we only report the closest instance
45+
isSink(node)
46+
}
4247
}
4348

4449
module HardcodedCryptographicValueFlow = TaintTracking::Global<HardcodedCryptographicValueConfig>;

0 commit comments

Comments
 (0)