C++: Generalize the ArgvSource flow source

This matches `isUserInput` and handles cases where `argv` has a different name,
which is allowed.
This commit is contained in:
Jeroen Ketema
2022-12-09 23:03:36 +01:00
parent 7d1f10bc78
commit 331fab5ac0

View File

@@ -89,9 +89,9 @@ private class LocalParameterSource extends LocalFlowSource {
private class ArgvSource extends LocalFlowSource {
ArgvSource() {
exists(Parameter argv |
argv.hasName("argv") and
argv.getFunction().hasGlobalName("main") and
exists(Function main, Parameter argv |
main.hasGlobalName("main") and
main.getParameter(1) = argv and
this.asExpr() = argv.getAnAccess()
)
}