Skip to content
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

CFE_SB_GetUserDataLength possible uninitialized variable (false alarm) #1192

Closed
skliper opened this issue Mar 1, 2021 · 1 comment · Fixed by #1234 or #1258
Closed

CFE_SB_GetUserDataLength possible uninitialized variable (false alarm) #1192

skliper opened this issue Mar 1, 2021 · 1 comment · Fixed by #1234 or #1258
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Mar 1, 2021

Is your feature request related to a problem? Please describe.
CFE_SB_GetUserDataLength use of TotalMsgSize causes static analysis warning. False alarm since MsgPtr is checked before CFE_MSG_GetSize, and &TotalMsgSize will never be NULL, so it's always set.

Describe the solution you'd like
Initialize to 0 to squash the warning.

Describe alternatives you've considered
Still dislike this function... don't use it.

Additional context
#1190, static analysis warnings

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added the bug label Mar 1, 2021
@skliper skliper added this to the 7.0.0 milestone Mar 1, 2021
@skliper
Copy link
Contributor Author

skliper commented Mar 1, 2021

Add test for coverage should check this behavior.

@skliper skliper changed the title CFE_SB_GetUserDataLength doesn't handle failures well - static analysis CFE_SB_GetUserDataLength possible uninitialized variable (false alarm) Mar 17, 2021
@skliper skliper added enhancement and removed bug labels Mar 23, 2021
astrogeco added a commit that referenced this issue Mar 24, 2021
Fix #1192, Initialize TotalMsgSize in CFE_SB_GetUserDataLength
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant