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

Update grut699-vxworks6 cfe_psp_start.c per white box unit testing results #41

Closed
skliper opened this issue Sep 25, 2019 · 5 comments
Closed
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@skliper
Copy link
Contributor

skliper commented Sep 25, 2019

During white box testing the following issue was identified with the grut699-vxworks6 version of cfe_psp_start.c

  • In CFE_PSP_GetRestartType, the input pointer is not checked for NULL prior to dereferencing it.

Issue identified during #14 white box testing, commit: [changeset:ad4e7c5f]

@skliper
Copy link
Contributor Author

skliper commented Sep 25, 2019

Imported from trac issue 37. Created by dasp on 2015-08-13T19:20:41, last modified: 2019-05-06T11:53:59

@skliper skliper self-assigned this Sep 25, 2019
@skliper skliper added the bug Something isn't working label Sep 25, 2019
@skliper
Copy link
Contributor Author

skliper commented Sep 25, 2019

Trac comment by sduran on 2015-08-17 15:15:50:

add NULL check

@skliper
Copy link
Contributor Author

skliper commented Sep 25, 2019

Trac comment by abrown4 on 2015-08-17 16:20:20:

Troublesome...this function doesn't have a convenient type to return to indicate "error". In cfe_es_resetTypes.h we have:
{{{
/*
** Reset types
*/
#define CFE_ES_PROCESSOR_RESET 1 /*Volatile disk, Critical Data Store and User Reserved memory could still be valid */
#define CFE_ES_POWERON_RESET 2 /*All memory has been cleared */
#define CFE_ES_APP_RESTART 3 /*Application only was reset */
}}}

..and the function is:
{{{
/******************************************************************************
** Function: CFE_PSP_GetRestartType()
**
** Purpose:
** Retrieve the CFE PSP reset type and subtype.
**
** Arguments:
** restartSubType [out] Reset Sub Type
**
** Return:
** Reset Type
*/
uint32 CFE_PSP_GetRestartType(uint32 *restartSubType)
{
*restartSubType = ResetSubtype;
return ResetType;
}
}}}

Options:

  1. We could change the return type to int32 (across all the PSPs) and return the existing CFE_PSP_INVALID_POINTER error (-2, from cfe_psp.h).
  2. We could make a zero=based *ERROR type for this function?
  3. We could not alter the return value and simply ignore the NULL argument. (With no signal back to the caller that they've done something "wrong".)

@skliper
Copy link
Contributor Author

skliper commented Sep 25, 2019

Trac comment by abrown4 on 2015-08-18 12:23:29:

commit: [changeset:1931394] Trac #41 Updated CFE_PSP_GetRestartType() to ignore null pointer. Updated white-box unit test for testing & added "()" for compiler warning.

@skliper
Copy link
Contributor Author

skliper commented Sep 25, 2019

Trac comment by jhageman on 2019-05-06 11:53:59:

Specific to non-community PSP so closing as invalid. Note changes were merged to techdev-pc-linux-uei, techdev-sp0-vxworks6.9 branches (but not techdev-ut699 for some reason). Not in framework release.

@skliper skliper closed this as completed Sep 25, 2019
@skliper skliper removed their assignment Sep 26, 2019
@skliper skliper added the invalid This doesn't seem right label Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant