You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Static analysis warns when using sizeof(sock->stream_name) in OS_strnlen check and later math OS_MAX_API_NAME - len passed to snprintf which out of context could then be a negative number (but isn't because OS_SocketAddrToString_Impl limits to OS_MAX_API_NAME, so this is a false positive):
Describe the solution you'd like
Truncating the port while fully adding the parent name or possibly even truncating both seems like it could be confusing. Just truncate at the end.
Describe alternatives you've considered
Could use OS_MAX_API_NAME to limit len in first check, but seems like overkill since the size is OS_MAX_PATH_LEN.
Additional context
Static analysis warning
Requester Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Static analysis warns when using sizeof(sock->stream_name) in OS_strnlen check and later math
OS_MAX_API_NAME - len
passed to snprintf which out of context could then be a negative number (but isn't because OS_SocketAddrToString_Impl limits to OS_MAX_API_NAME, so this is a false positive):osal/src/os/shared/src/osapi-sockets.c
Lines 101 to 110 in ff4f523
Describe the solution you'd like
Truncating the port while fully adding the parent name or possibly even truncating both seems like it could be confusing. Just truncate at the end.
Describe alternatives you've considered
Could use OS_MAX_API_NAME to limit len in first check, but seems like overkill since the size is OS_MAX_PATH_LEN.
Additional context
Static analysis warning
Requester Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered: