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

TblHandle used before validation in CFE_TBL_Load #687

Closed
skliper opened this issue May 7, 2020 · 3 comments · Fixed by #688
Closed

TblHandle used before validation in CFE_TBL_Load #687

skliper opened this issue May 7, 2020 · 3 comments · Fixed by #688
Assignees
Labels
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented May 7, 2020

Describe the bug
TblHandle used before validation

To Reproduce
See code snip, invalid handle could cause fault

Expected behavior
Validate handle before using

Code snips

CFE_TBL_AccessDescriptor_t *AccessDescPtr = &CFE_TBL_TaskData.Handles[TblHandle];
CFE_TBL_RegistryRec_t *RegRecPtr = &CFE_TBL_TaskData.Registry[AccessDescPtr->RegIndex];
char AppName[OS_MAX_API_NAME]={"UNKNOWN"};
bool FirstTime = false;
/* Verify access rights and get a valid Application ID for calling App */
Status = CFE_TBL_ValidateAccess(TblHandle, &ThisAppId);

System observed on:
In code

Additional context
None

Reporter Info
Jacob Hageman - NASA/GSFC

@skliper
Copy link
Contributor Author

skliper commented May 7, 2020

Ping @dmills3

@jphickey
Copy link
Contributor

jphickey commented May 7, 2020

deleted my previous comment - I see it now ... yes this is a bug.

@jphickey
Copy link
Contributor

jphickey commented May 7, 2020

This code was last modified by @CDKnightNASA in #606 so probably should get his take on best fix.

@CDKnightNASA CDKnightNASA self-assigned this May 7, 2020
CDKnightNASA added a commit to CDKnightNASA/cFE that referenced this issue May 7, 2020
CDKnightNASA added a commit to CDKnightNASA/cFE that referenced this issue May 7, 2020
@skliper skliper added this to the 6.8.0 milestone May 12, 2020
astrogeco added a commit that referenced this issue May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants