You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The following check for CFE_SUCCESS isn't independent from the NULL pointer test in CFE_ES_RegisterCDSEx:
384 [ + + ]: 6 : if (RegRecPtr != NULL)
385 : : {
386 : : /* Account for the extra header which will be added /
387 : 5 : NewBlockSize = UserBlockSize;
388 : 5 : NewBlockSize += sizeof(CFE_ES_CDS_BlockHeader_t);
389 : :
390 : : / If a reallocation is needed, the old block may need to be freed first */
391 [ + - ][ + + ]: 5 : if (Status == CFE_SUCCESS && RegRecPtr->BlockOffset != 0 && NewBlockSize != RegRecPtr->BlockSize)
[ + + ]
here:
/* Account for the extra header which will be added */
NewBlockSize=UserBlockSize;
NewBlockSize+=sizeof(CFE_ES_CDS_BlockHeader_t);
/* If a reallocation is needed, the old block may need to be freed first */
if (Status==CFE_SUCCESS&&RegRecPtr->BlockOffset!=0&&NewBlockSize!=RegRecPtr->BlockSize)
{
Describe the solution you'd like
Recommend just checking for CFE_SUCCESS instead of NULL pointer check since it's already tested. We don't have a requirement to check for a NULL pointer within internal functions where it can't be NULL.
Describe alternatives you've considered
None
Additional context
None
Requester Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered:
Code coverage is not possible.
The only way to traverse this branch is if Status != CFE_SUCCESS but the only way to set Status != CFE_SUCCESS is if RegRecPtr == NULL which if occurs, this code block will not be executed.
Is your feature request related to a problem? Please describe.
The following check for CFE_SUCCESS isn't independent from the NULL pointer test in CFE_ES_RegisterCDSEx:
384 [ + + ]: 6 : if (RegRecPtr != NULL)
385 : : {
386 : : /* Account for the extra header which will be added /
387 : 5 : NewBlockSize = UserBlockSize;
388 : 5 : NewBlockSize += sizeof(CFE_ES_CDS_BlockHeader_t);
389 : :
390 : : / If a reallocation is needed, the old block may need to be freed first */
391 [ + - ][ + + ]: 5 : if (Status == CFE_SUCCESS && RegRecPtr->BlockOffset != 0 && NewBlockSize != RegRecPtr->BlockSize)
[ + + ]
here:
cFE/modules/es/fsw/src/cfe_es_cds.c
Lines 384 to 392 in e5d4ed9
Describe the solution you'd like
Recommend just checking for CFE_SUCCESS instead of NULL pointer check since it's already tested. We don't have a requirement to check for a NULL pointer within internal functions where it can't be NULL.
Describe alternatives you've considered
None
Additional context
None
Requester Info
Jacob Hageman - NASA/GSFC
The text was updated successfully, but these errors were encountered: