Update rust/ql/examples/snippets/simple_constant_password.ql

Co-authored-by: Tom Hvitved <hvitved@github.com>
This commit is contained in:
Geoffrey White
2025-11-12 14:37:45 +00:00
committed by GitHub
parent 109abddc36
commit 9598772477

View File

@@ -30,9 +30,10 @@ module ConstantPasswordConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node node) {
// `node` is an argument whose corresponding parameter name matches the pattern "pass%"
exists(CallExpr call, Function target, int argIndex |
exists(CallExpr call, Function target, int argIndex, Variable v |
call.getStaticTarget() = target and
target.getParam(argIndex).getPat().(IdentPat).getName().getText().matches("pass%") and
v.getParameter() = target.getParam(argIndex) and
v.getText().matches("pass%") and
call.getArg(argIndex) = node.asExpr().getExpr()
)
}