-
Notifications
You must be signed in to change notification settings - Fork 203
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
Remove remaining stray uses of sprintf() #2172
Labels
Comments
Yeah, that would be a good update from my point of view. Most of it's in tests which might not be a high priority, but there's a handful of flight code use still. |
thnkslprpt
changed the title
Remove the few remaining stray uses of sprintf()?
Remove remaining stray uses of sprintf()?
Oct 18, 2022
thnkslprpt
changed the title
Remove remaining stray uses of sprintf()?
Remove remaining stray uses of sprintf()
Oct 18, 2022
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist
Describe the bug
A few stray uses of sprintf() remain in cFE (mostly in the test code, but not entirely).
The simple cases will be converted to snprintf() to enforce a maximum size for the buffer being written into.
A couple of cases have their own issues open already with further changes being considered, so I will probably leave those to be addressed there (#1465 and #1511)
Expected behavior
No use of sprintf() in the code base (including test code).
Code snips
cFE/modules/es/fsw/src/cfe_es_cds.c
Line 662 in be88a07
cFE/modules/cfe_testcase/src/tbl_content_access_test.c
Line 121 in be88a07
Reporter Info
Avi Weiss @thnkslprpt
Previous discussion opening this issue:
I concur that
snprintf
has some caveats/dangers - particularly with respect to the return code and handling that properly - whereassprintf()
is a buffer overflow exploit in almost all use-cases, and should rightfully be banned.Originally posted by @jphickey in #824 (comment)
There are still a few stray uses of sprintf() across cFS. Should these be removed?
The text was updated successfully, but these errors were encountered: