Skip to content

C/CPP: Update FlowSources to add wmain #19510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cpp/ql/lib/change-notes/2025-05-16-wmain-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: feature
---
* Added support for `wmain` as part of the ArgvSource model.
4 changes: 2 additions & 2 deletions cpp/ql/lib/semmle/code/cpp/security/FlowSources.qll
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ private class LocalModelSource extends LocalFlowSource {
}

/**
* A local data flow source that the `argv` parameter to `main`.
* A local data flow source that the `argv` parameter to `main` or `wmain`.
*/
private class ArgvSource extends LocalFlowSource {
ArgvSource() {
exists(Function main, Parameter argv |
main.hasGlobalName("main") and
main.hasGlobalName(["main", "wmain"]) and
main.getParameter(1) = argv and
this.asParameter(2) = argv
)
Expand Down