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

No null pointer check on TblHandles in CFE_TBL_GetAddresses and CFE_TBL_ReleaseAddresses #1751

Closed
nmullane opened this issue Aug 2, 2021 · 0 comments · Fixed by #1752 or #1759
Closed
Assignees
Milestone

Comments

@nmullane
Copy link
Contributor

nmullane commented Aug 2, 2021

Describe the bug
CFE_TBL_GetAddresses does not check that the array of TblHandles is not NULL and will cause a segmentation fault. A similar issue appears to also exist in CFE_TBL_ReleaseAddresses.

To Reproduce
Steps to reproduce the behavior:

  1. The following line from my fork for Add table api functional tests #1734 will cause a segmentation fault instead of gracefully returning a CFE_TBL_BAD_ARGUMENT
    UtAssert_INT32_EQ(CFE_TBL_GetAddresses((void ***)&TblPtrs, numValidTbls, NULL), CFE_TBL_BAD_ARGUMENT);
    Whereas when the input TblPtrs is NULL, CFE_TBL_BAD_ARGUMENT is correctly returned.
  2. Similarly the following line will cause a segmentation fault from CFE_TBL_ReleaseAddresses
    UtAssert_INT32_EQ(CFE_TBL_ReleaseAddresses(numValidTbls, NULL), CFE_TBL_BAD_ARGUMENT);

Expected behavior

  • CFE_TBL_GetAddresses should return CFE_TBL_BAD_ARGUMENT when the pointer TblHandles is NULL.
  • CFE_TBL_ReleaseAddresses should return CFE_TBL_BAD_ARGUMENT when the pointer TblHandles is NULL.

System observed on:

  • Hardware: PC
  • OS: Ubuntu 20.04

Reporter Info
Niall Mullane - GSFC 582 Intern

@skliper skliper added this to the 7.0.0 milestone Aug 3, 2021
astrogeco added a commit that referenced this issue Aug 4, 2021
…heck-in-get-release-addresses

Fix #1751, Add null pointer check to table GetAddresses and ReleaseAddresses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants