Skip to content

Commit bea67ab

Browse files
authored
Merge pull request #11643 from jketema/generalize-argv
2 parents 1bf82ce + 1e1974c commit bea67ab

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The `ArgvSource` flow source has been generalized to handle cases where the argument vector of `main` is not named `argv`.

cpp/ql/lib/semmle/code/cpp/security/FlowSources.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ private class LocalParameterSource extends LocalFlowSource {
8989

9090
private class ArgvSource extends LocalFlowSource {
9191
ArgvSource() {
92-
exists(Parameter argv |
93-
argv.hasName("argv") and
94-
argv.getFunction().hasGlobalName("main") and
92+
exists(Function main, Parameter argv |
93+
main.hasGlobalName("main") and
94+
main.getParameter(1) = argv and
9595
this.asExpr() = argv.getAnAccess()
9696
)
9797
}

0 commit comments

Comments
 (0)