-
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
Rust: New query for bad 'ctor' initialization #18097
base: main
Are you sure you want to change the base?
Conversation
QHelp previews: rust/ql/src/queries/security/CWE-696/BadCtorInitialization.qhelpBad 'ctor' initializationCalling functions and methods in the Rust RecommendationDo not call any part of the
ExampleIn the following example, a
The issue can be fixed by replacing
References
|
Sounds right to me.
For global data flow we use the resolved paths that the extractor gives. But I don't think we have a suitable API for using that in queries yet. In C we have |
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.
Looks good to me 😄
Yep - or |
New (requested) query for bad
ctor
initialization. See the.qhelp
for an explanation of what this is. Note three limitations:#[ctor]
/#[dtor]
.TODO: