Skip to content

Commit 9598772

Browse files
geoffw0hvitved
andauthored
Update rust/ql/examples/snippets/simple_constant_password.ql
Co-authored-by: Tom Hvitved <[email protected]>
1 parent 109abdd commit 9598772

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rust/ql/examples/snippets/simple_constant_password.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ module ConstantPasswordConfig implements DataFlow::ConfigSig {
3030

3131
predicate isSink(DataFlow::Node node) {
3232
// `node` is an argument whose corresponding parameter name matches the pattern "pass%"
33-
exists(CallExpr call, Function target, int argIndex |
33+
exists(CallExpr call, Function target, int argIndex, Variable v |
3434
call.getStaticTarget() = target and
35-
target.getParam(argIndex).getPat().(IdentPat).getName().getText().matches("pass%") and
35+
v.getParameter() = target.getParam(argIndex) and
36+
v.getText().matches("pass%") and
3637
call.getArg(argIndex) = node.asExpr().getExpr()
3738
)
3839
}

0 commit comments

Comments
 (0)