-
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
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 |
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.
LGTM 💖
Left some comments and suggestions for your consideration (but these are minor, and I didn't want to block this PR).
rust/ql/src/queries/security/CWE-696/BadCtorInitialization.qhelp
Outdated
Show resolved
Hide resolved
rust/ql/src/queries/security/CWE-696/BadCtorInitialization.qhelp
Outdated
Show resolved
Hide resolved
rust/ql/src/queries/security/CWE-696/BadCtorInitialization.qhelp
Outdated
Show resolved
Hide resolved
Co-authored-by: mc <[email protected]>
Thanks for the docs review, all changes accepted. |
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.
Thanks for looking at my comments/suggestions @geoffw0 🙇🏻
LGTM
New (requested) query for bad
ctor
initialization. See the.qhelp
for an explanation of what this is. Note three limitations:#[ctor]
/#[dtor]
.TODO: