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
gh-101703: use snprintf instead of sprintf
#101729
base: main
Are you sure you want to change the base?
Conversation
38f8e7d
to
b33fb2d
Compare
|
Ok, the first part with constant sized elements is done. Now, more complex ones. |
|
Looks like we have |
|
Almost done! There are a couple left, but I don't quite understand the code and I will highly appreciate help / advice on these cases:
|
|
CI results:
|
|
@Yhg1s @gvanrossum it is ready to be reviewed :) |
|
I've made the requested changes, thanks for the suggestions |
Several points of interest:
sprintfis indeed insecure generally: https://rules.sonarsource.com/c/RSPEC-6069 But, for our cases - I was not able to find a single insecure place, so I don't mark this PR as:security:snprintfis also listed as not secure here: https://clang.llvm.org/docs/analyzer/checkers.html#security-insecureapi-deprecatedorunsafebufferhandling-csnprintfis reported to be slightly slower thansprintf