Skip to content

Commit 3a03bb5

Browse files
committed
Rust: Repair rust/hard-coded-cryptographic-value, which had an unintentional dependence on the taint flow.
1 parent 74a350a commit 3a03bb5

File tree

2 files changed

+89
-89
lines changed

2 files changed

+89
-89
lines changed

rust/ql/lib/codeql/rust/security/HardcodedCryptographicValueExtensions.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,15 @@ module HardcodedCryptographicValue {
6969
/**
7070
* An array initialized from a list of literals, considered as a single flow source. For example:
7171
* ```
72-
* `[0, 0, 0, 0]`
72+
* [0, 0, 0, 0]
73+
* [0; 10]
7374
* ```
7475
*/
7576
private class ArrayListSource extends Source {
76-
ArrayListSource() { this.asExpr().getExpr().(ArrayListExpr).getExpr(_) instanceof LiteralExpr }
77+
ArrayListSource() {
78+
this.asExpr().getExpr().(ArrayListExpr).getExpr(_) instanceof LiteralExpr or
79+
this.asExpr().getExpr().(ArrayRepeatExpr).getRepeatOperand() instanceof LiteralExpr
80+
}
7781
}
7882

7983
/**

0 commit comments

Comments
 (0)