-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add CodeQL recommendation against Path.Combine #18865
base: main
Are you sure you want to change the base?
Add CodeQL recommendation against Path.Combine #18865
Conversation
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.
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
csharp/ql/test/query-tests/Bad Practices/Path Combine/PathCombine.cs:3
- [nitpick] The class name 'EmptyCatchBlock' does not convey its purpose related to Path.Combine testing. Consider renaming it to 'PathCombineTest' for better clarity.
class EmptyCatchBlock
QHelp previews: csharp/ql/src/Bad Practices/PathCombine.qhelpCall to System.IO.Path.Combine
RecommendationUse References
|
I will start a DCA run to see how this impacts the security and quality suite. |
The docs for Path.Combine warns:
Important
This method assumes that the first argument is an absolute path and that the following argument or arguments are relative paths. If this is not the case, and particularly if any subsequent arguments are strings input by the user, call the Join or TryJoin method instead.
This commit adds a corresponding CodeQL query to recommend against Path.Combine.