mirror of
https://github.com/github/codeql.git
synced 2026-07-04 19:15:29 +02:00
Update rust/ql/lib/codeql/rust/security/HardcodedCryptographicValueExtensions.qll
Co-authored-by: Tom Hvitved <hvitved@github.com>
This commit is contained in:
@@ -67,9 +67,9 @@ module HardcodedCryptographicValue {
|
||||
private predicate isConstant(Expr e) {
|
||||
e instanceof LiteralExpr // e.g. `0`
|
||||
or
|
||||
e.(ArrayListExpr).getExpr(_) instanceof LiteralExpr // e.g. `[0, 0, 0, 0]`
|
||||
forex(Expr elem | elem = e.(ArrayListExpr).getExpr(_) | isConstant(elem)) // e.g. `[0, 0, 0, 0]`
|
||||
or
|
||||
e.(ArrayRepeatExpr).getRepeatOperand() instanceof LiteralExpr // e.g. `[0; 10]`
|
||||
isConstant(e.(ArrayRepeatExpr).getRepeatOperand()) // e.g. `[0; 10]`
|
||||
or
|
||||
// e.g. `const MY_CONST: u64 = ...`
|
||||
e = any(Const c).getBody()
|
||||
|
||||
Reference in New Issue
Block a user