Skip to content

Commit

Permalink
Merge pull request #1721 from zanzaben/fic1718_TaskID_ToIndex_missing…
Browse files Browse the repository at this point in the history
…_null_check

Fix #1718, Add null check to CFE_ES_TaskID_ToIndex.
  • Loading branch information
astrogeco authored Jul 28, 2021
2 parents 5501fbb + 52b719d commit 28f4792
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/es/fsw/src/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2174,6 +2174,11 @@ CFE_Status_t CFE_ES_TaskID_ToIndex(CFE_ES_TaskId_t TaskID, uint32 *Idx)
return CFE_ES_ERR_RESOURCEID_NOT_VALID;
}

if (Idx == NULL)
{
return CFE_ES_BAD_ARGUMENT;
}

OsalID = CFE_ES_TaskId_ToOSAL(TaskID);
if (OS_ObjectIdToArrayIndex(OS_OBJECT_TYPE_OS_TASK, OsalID, &OsalIndex) != OS_SUCCESS)
{
Expand Down

0 comments on commit 28f4792

Please sign in to comment.