Skip to content

Commit

Permalink
Update #943, add NULL check for Idx parameter
Browse files Browse the repository at this point in the history
Add a NULL check to CFE_ES_ResourceID_ToIndex_Internal().  Although
this function is internal, it does check arguments on behalf of the
public APIs which call this.
  • Loading branch information
jphickey committed Oct 19, 2020
1 parent 56cd634 commit 4356693
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fsw/cfe-core/src/es/cfe_es_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
*/
int32 CFE_ES_ResourceID_ToIndex_Internal(uint32 Serial, uint32 TableSize, uint32 *Idx)
{
if (Idx == NULL)
{
return CFE_ES_ERR_BUFFER;
}

if (Serial > CFE_ES_RESOURCEID_MAX)
{
return CFE_ES_ERR_RESOURCEID_NOT_VALID;
Expand Down

0 comments on commit 4356693

Please sign in to comment.