Skip to content

Commit 1f4ae86

Browse files
authored
Apply suggestions from code review
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
1 parent b5ec9c2 commit 1f4ae86

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ module HardcodedCryptographicValue {
7272
isConstant(e.(ArrayRepeatExpr).getRepeatOperand()) // e.g. `[0; 10]`
7373
or
7474
// e.g. `const MY_CONST: u64 = ...`
75+
// the constant initializer / body is the preferred source location for flow paths, when available.
7576
e = any(Const c).getBody()
7677
or
7778
// e.g. `u64::MAX`
79+
// when the constant initializer is not available as a source location (case above), use the access instead.
7880
e instanceof ConstAccess and
7981
not exists(e.(ConstAccess).getConst().getBody())
8082
or

0 commit comments

Comments
 (0)