-
Notifications
You must be signed in to change notification settings - Fork 218
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
Convert from strlen to strnlen where appropriate #808
Comments
Unfortunately My recommendation is to use |
That's what I get for copy pasting from a security analysis report, suggestion noted! |
We could always make an OSAL wrapper around I can easily see that turning into a dumping ground for "functions the ISO C standard should have but doesn't" |
Create a wrapper around memchr() that mimics the non-C99 function "strnlen()" which is in POSIX-2008. Use this instead of strlen() whenever the string being checked either originates in or will be copied into a fixed-length array buffer.
Fix #808, length-limited string length checks
…ests Fix nasa#808, ES API functional tests
Is your feature request related to a problem? Please describe.
Per security standards strlen should be avoided if possible:
Describe the solution you'd like
Replace with strnlen where possible.
Describe alternatives you've considered
None
Additional context
Security analysis warning
Requester Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered: