mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Update rust/ql/examples/snippets/simple_constant_password.ql
Co-authored-by: Tom Hvitved <hvitved@github.com>
This commit is contained in:
@@ -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()
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user