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

SAMPLE_ProcessCC needs to check return code of CFE_TBL_GetAddress call #28

Closed
jphickey opened this issue Dec 5, 2019 · 0 comments · Fixed by #34
Closed

SAMPLE_ProcessCC needs to check return code of CFE_TBL_GetAddress call #28

jphickey opened this issue Dec 5, 2019 · 0 comments · Fixed by #34
Labels
enhancement New feature or request
Milestone

Comments

@jphickey
Copy link
Contributor

jphickey commented Dec 5, 2019

Describe the bug
The SAMPLE_ProcessCC example calls CFE_TBL_GetAddress() and then immediately proceeds to dereference the pointer, without checking its return code.

To Reproduce
This is primarily evident in unit test, where the CFE_TBL_GetAddress() call can be forced to fail. It outputs a NULL pointer in this case and subsequently segfaults.

Expected behavior
The SAMPLE_ProcessCC() should not attempt to dereference the pointer output of CFE_TBL_GetAddress() unless that function actually returns CFE_SUCCESS

System observed on:
Ubuntu 18.04 LTS 64-bit (when running UT)

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit that referenced this issue Dec 6, 2019
The code must not dereference the pointer unless the call
returned CFE_SUCCESS, otherwise the pointer is not valid.
jphickey added a commit that referenced this issue Dec 6, 2019
The code must not dereference the pointer unless the call
returned CFE_SUCCESS, otherwise the pointer is not valid.
skliper pushed a commit that referenced this issue Dec 30, 2019
The code must not dereference the pointer unless the call
returned CFE_SUCCESS, otherwise the pointer is not valid.
@skliper skliper added this to the 1.2.0 milestone Dec 30, 2019
@skliper skliper added the enhancement New feature or request label Dec 30, 2019
skliper added a commit that referenced this issue Dec 30, 2019
Fix #23, #25, #28, #30
Reviewed and approved at 2019-12-18 CCB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants