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
Cpp non constant format as path query #15628
base: main
Are you sure you want to change the base?
Cpp non constant format as path query #15628
Conversation
Removed dead comment
…cppnon-constant-format-alter-not-const-source
…cppnon-constant-format-alter-not-const-source # Conflicts: # cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql
…ttps://github.com/microsoft/codeql into 51-2cppnon-constant-format-alter-not-const-source
… We will test if this causes undesirable cases in DCA and then choose which approach is best.
…he output alert to be more precise on what is being alerted. Minor changes to the query itself to avoid redundancies with argv.
Co-authored-by: Mathias Vorreiter Pedersen <[email protected]>
…ttps://github.com/microsoft/codeql into 51-2cppnon-constant-format-alter-not-const-source
… cpp-non-constant-format-as-path-query # Conflicts: # cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql
…re accidentally removed in prior merge with other non-const branches)
| p = node.asParameter() and | ||
| // Ignore main's argv parameter as it is already considered a `FlowSource` | ||
| // not ignoring it will result in path redundancies | ||
| (f.getName() = "main" implies p.getName() != "argv") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes the parameter is always called argv. That does not have to be true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I should've copied more verbatim what the current argv model is doing. I'll fix that.
Modifying the cpp non const format query to be a path query.