From 52b719d8bda8dcff7d25b5b09c57428a73a444a9 Mon Sep 17 00:00:00 2001 From: Alex Campbell Date: Wed, 28 Jul 2021 10:44:58 -0400 Subject: [PATCH] Fix #1718, Add null check to CFE_ES_TaskID_ToIndex. --- modules/es/fsw/src/cfe_es_api.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/es/fsw/src/cfe_es_api.c b/modules/es/fsw/src/cfe_es_api.c index a5235e17d..f43bfc024 100644 --- a/modules/es/fsw/src/cfe_es_api.c +++ b/modules/es/fsw/src/cfe_es_api.c @@ -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) {