Skip to content

Commit

Permalink
Merge pull request #1271 from zanzaben/fix1267_GetAppId_null_pointer
Browse files Browse the repository at this point in the history
Fix #1267, add null pointer check
Fix #1269, refactor CFE_ES_ERR_BUFFER to CFE_ES_BAD_ARGUMENT
  • Loading branch information
astrogeco committed Mar 30, 2021
2 parents de01f9e + fe95bec commit db39522
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 34 deletions.
8 changes: 0 additions & 8 deletions modules/core_api/fsw/inc/cfe_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,6 @@ typedef int32 CFE_Status_t;
*/
#define CFE_ES_ERR_NAME_NOT_FOUND ((CFE_Status_t)0xc4000002)

/**
* @brief Invalid Pointer
*
* Invalid pointer argument (NULL)
*
*/
#define CFE_ES_ERR_BUFFER ((CFE_Status_t)0xc4000003)

/**
* @brief Application Create Error
*
Expand Down
49 changes: 32 additions & 17 deletions modules/core_api/fsw/inc/cfe_es.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ int32 CFE_ES_GetResetType(uint32 *ResetSubtypePtr);
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetResetType, #CFE_ES_GetAppIDByName, #CFE_ES_GetAppName, #CFE_ES_GetTaskInfo
**
Expand All @@ -529,7 +529,7 @@ CFE_Status_t CFE_ES_GetAppID(CFE_ES_AppId_t *AppIdPtr);
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
******************************************************************************/
CFE_Status_t CFE_ES_GetTaskID(CFE_ES_TaskId_t *TaskIdPtr);
Expand All @@ -551,7 +551,7 @@ CFE_Status_t CFE_ES_GetTaskID(CFE_ES_TaskId_t *TaskIdPtr);
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetAppID, #CFE_ES_GetAppName, #CFE_ES_GetAppInfo
**
Expand All @@ -575,7 +575,7 @@ CFE_Status_t CFE_ES_GetAppIDByName(CFE_ES_AppId_t *AppIdPtr, const char *AppName
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetLibName
**
Expand Down Expand Up @@ -605,6 +605,7 @@ CFE_Status_t CFE_ES_GetLibIDByName(CFE_ES_LibId_t *LibIdPtr, const char *LibName
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetAppID, #CFE_ES_GetAppIDByName, #CFE_ES_GetAppInfo
**
Expand Down Expand Up @@ -634,6 +635,7 @@ CFE_Status_t CFE_ES_GetAppName(char *AppName, CFE_ES_AppId_t AppId, size_t Buffe
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetLibIDByName
**
Expand All @@ -659,7 +661,7 @@ CFE_Status_t CFE_ES_GetLibName(char *LibName, CFE_ES_LibId_t LibId, size_t Buffe
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetAppID, #CFE_ES_GetAppIDByName, #CFE_ES_GetAppName
**
Expand Down Expand Up @@ -687,7 +689,7 @@ CFE_Status_t CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_AppId_t AppId);
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetTaskID, #CFE_ES_GetTaskIDByName, #CFE_ES_GetTaskName
**
Expand Down Expand Up @@ -719,7 +721,7 @@ CFE_Status_t CFE_ES_GetTaskInfo(CFE_ES_TaskInfo_t *TaskInfo, CFE_ES_TaskId_t Tas
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetLibIDByName, #CFE_ES_GetLibName
**
Expand Down Expand Up @@ -751,7 +753,7 @@ int32 CFE_ES_GetLibInfo(CFE_ES_AppInfo_t *LibInfo, CFE_ES_LibId_t LibId);
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetLibInfo, #CFE_ES_GetAppInfo
**
Expand Down Expand Up @@ -800,6 +802,7 @@ int32 CFE_ES_GetModuleInfo(CFE_ES_AppInfo_t *ModuleInfo, CFE_ResourceId_t Resour
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_CHILD_TASK_CREATE \copybrief CFE_ES_ERR_CHILD_TASK_CREATE
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_DeleteChildTask, #CFE_ES_ExitChildTask
**
Expand All @@ -825,7 +828,7 @@ CFE_Status_t CFE_ES_CreateChildTask(CFE_ES_TaskId_t *TaskIdPtr, const char *Task
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetTaskName
**
Expand Down Expand Up @@ -855,6 +858,7 @@ CFE_Status_t CFE_ES_GetTaskIDByName(CFE_ES_TaskId_t *TaskIdPtr, const char *Task
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetTaskIDByName
**
Expand Down Expand Up @@ -947,6 +951,7 @@ void CFE_ES_BackgroundWakeup(void);
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_SYS_LOG_FULL \copybrief CFE_ES_ERR_SYS_LOG_FULL
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
******************************************************************************/
CFE_Status_t CFE_ES_WriteToSysLog(const char *SpecStringPtr, ...) OS_PRINTF(1, 2);
Expand Down Expand Up @@ -1033,6 +1038,8 @@ void CFE_ES_ProcessAsyncEvent(void);
** \retval #CFE_ES_CDS_ALREADY_EXISTS \copybrief CFE_ES_CDS_ALREADY_EXISTS
** \retval #CFE_ES_CDS_INVALID_SIZE \copybrief CFE_ES_CDS_INVALID_SIZE
** \retval #CFE_ES_CDS_INVALID_NAME \copybrief CFE_ES_CDS_INVALID_NAME
** \retval #CFE_ES_CDS_REGISTRY_FULL \copybrief CFE_ES_CDS_REGISTRY_FULL
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_CopyToCDS, #CFE_ES_RestoreFromCDS
**
Expand All @@ -1056,7 +1063,7 @@ CFE_Status_t CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *HandlePtr, size_t BlockSize,
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetCDSBlockName
**
Expand Down Expand Up @@ -1086,6 +1093,7 @@ CFE_Status_t CFE_ES_GetCDSBlockIDByName(CFE_ES_CDSHandle_t *BlockIdPtr, const ch
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetCDSBlockIDByName
**
Expand All @@ -1111,6 +1119,7 @@ CFE_Status_t CFE_ES_GetCDSBlockName(char *BlockName, CFE_ES_CDSHandle_t BlockId,
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_RegisterCDS, #CFE_ES_RestoreFromCDS
**
Expand Down Expand Up @@ -1138,9 +1147,10 @@ CFE_Status_t CFE_ES_CopyToCDS(CFE_ES_CDSHandle_t Handle, void *DataToCopy);
** the CDS. *RestoreToMemory is the contents of the specified CDS.
**
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_CDS_BLOCK_CRC_ERR \copybrief CFE_ES_CDS_BLOCK_CRC_ERR
** \retval #CFE_ES_CDS_BLOCK_CRC_ERR \copybrief CFE_ES_CDS_BLOCK_CRC_ERR
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_RegisterCDS, #CFE_ES_CopyToCDS
**
Expand Down Expand Up @@ -1297,6 +1307,7 @@ int32 CFE_ES_PoolDelete(CFE_ES_MemHandle_t PoolID);
** \return Bytes Allocated, or error code \ref CFEReturnCodes
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_ERR_MEM_BLOCK_SIZE \copybrief CFE_ES_ERR_MEM_BLOCK_SIZE
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, #CFE_ES_PoolCreateEx, #CFE_ES_PutPoolBuf, #CFE_ES_GetMemPoolStats,
*#CFE_ES_GetPoolBufInfo
Expand All @@ -1322,6 +1333,7 @@ int32 CFE_ES_GetPoolBuf(CFE_ES_MemPoolBuf_t *BufPtr, CFE_ES_MemHandle_t PoolID,
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_BUFFER_NOT_IN_POOL \copybrief CFE_ES_BUFFER_NOT_IN_POOL
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, #CFE_ES_PoolCreateEx, #CFE_ES_GetPoolBuf, #CFE_ES_GetMemPoolStats,
*#CFE_ES_PutPoolBuf
Expand All @@ -1345,6 +1357,7 @@ CFE_Status_t CFE_ES_GetPoolBufInfo(CFE_ES_MemHandle_t PoolID, CFE_ES_MemPoolBuf_
**
** \return Bytes released, or error code \ref CFEReturnCodes
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, #CFE_ES_PoolCreateEx, #CFE_ES_GetPoolBuf, #CFE_ES_GetMemPoolStats,
*#CFE_ES_GetPoolBufInfo
Expand Down Expand Up @@ -1373,6 +1386,7 @@ int32 CFE_ES_PutPoolBuf(CFE_ES_MemHandle_t PoolID, CFE_ES_MemPoolBuf_t BufPtr);
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, #CFE_ES_PoolCreateEx, #CFE_ES_GetPoolBuf, #CFE_ES_PutPoolBuf
**
Expand Down Expand Up @@ -1462,8 +1476,8 @@ void CFE_ES_PerfLogAdd(uint32 Marker, uint32 EntryExit);
** \param[out] *CounterIdPtr The Counter Id of the newly created counter.
**
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_IncrementGenCounter, #CFE_ES_DeleteGenCounter, #CFE_ES_SetGenCount, #CFE_ES_GetGenCount,
*#CFE_ES_GetGenCounterIDByName
Expand Down Expand Up @@ -1506,8 +1520,8 @@ CFE_Status_t CFE_ES_DeleteGenCounter(CFE_ES_CounterId_t CounterId);
** \param[in] CounterId The Counter to be incremented.
**
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_RegisterGenCounter, #CFE_ES_DeleteGenCounter, #CFE_ES_SetGenCount, #CFE_ES_GetGenCount,
*#CFE_ES_GetGenCounterIDByName
Expand Down Expand Up @@ -1579,7 +1593,7 @@ CFE_Status_t CFE_ES_GetGenCount(CFE_ES_CounterId_t CounterId, uint32 *Count);
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND
** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetGenCounterName
**
Expand Down Expand Up @@ -1609,6 +1623,7 @@ CFE_Status_t CFE_ES_GetGenCounterIDByName(CFE_ES_CounterId_t *CounterIdPtr, cons
** \return Execution status, see \ref CFEReturnCodes
** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID
** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT
**
** \sa #CFE_ES_GetGenCounterIDByName
**
Expand Down
16 changes: 13 additions & 3 deletions modules/es/fsw/src/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,11 @@ int32 CFE_ES_GetAppID(CFE_ES_AppId_t *AppIdPtr)
CFE_ES_AppRecord_t *AppRecPtr;
int32 Result;

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

CFE_ES_LockSharedData(__func__, __LINE__);

AppRecPtr = CFE_ES_GetAppRecordByContext();
Expand Down Expand Up @@ -780,6 +785,11 @@ int32 CFE_ES_GetTaskID(CFE_ES_TaskId_t *TaskIdPtr)
int32 Result;
CFE_ES_TaskRecord_t *TaskRecPtr;

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

CFE_ES_LockSharedData(__func__, __LINE__);
TaskRecPtr = CFE_ES_GetTaskRecordByContext();
if (TaskRecPtr == NULL)
Expand Down Expand Up @@ -927,7 +937,7 @@ int32 CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_AppId_t AppId)
if (AppInfo == NULL)
{
CFE_ES_WriteToSysLog("CFE_ES_GetAppInfo: Invalid Parameter ( Null Pointer )\n");
return CFE_ES_ERR_BUFFER;
return CFE_ES_BAD_ARGUMENT;
}

memset(AppInfo, 0, sizeof(*AppInfo));
Expand Down Expand Up @@ -1017,7 +1027,7 @@ int32 CFE_ES_GetLibInfo(CFE_ES_AppInfo_t *LibInfo, CFE_ES_LibId_t LibId)
if (LibInfo == NULL)
{
CFE_ES_WriteToSysLog("CFE_ES_GetLibInfo: Invalid Parameter ( Null Pointer )\n");
return CFE_ES_ERR_BUFFER;
return CFE_ES_BAD_ARGUMENT;
}

memset(LibInfo, 0, sizeof(*LibInfo));
Expand Down Expand Up @@ -1105,7 +1115,7 @@ int32 CFE_ES_GetTaskInfo(CFE_ES_TaskInfo_t *TaskInfo, CFE_ES_TaskId_t TaskId)
if (TaskInfo == NULL)
{
CFE_ES_WriteToSysLog("CFE_ES_GetTaskInfo: Invalid Parameter ( Null Pointer )\n");
return CFE_ES_ERR_BUFFER;
return CFE_ES_BAD_ARGUMENT;
}

memset(TaskInfo, 0, sizeof(*TaskInfo));
Expand Down
4 changes: 2 additions & 2 deletions modules/es/ut-coverage/es_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ void TestApps(void)
ES_ResetUnitTest();
ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, NULL);
AppId = CFE_ES_AppRecordGetID(UtAppRecPtr);
UT_Report(__FILE__, __LINE__, CFE_ES_GetAppInfo(NULL, AppId) == CFE_ES_ERR_BUFFER, "CFE_ES_GetAppInfo",
UT_Report(__FILE__, __LINE__, CFE_ES_GetAppInfo(NULL, AppId) == CFE_ES_BAD_ARGUMENT, "CFE_ES_GetAppInfo",
"Null application information pointer");

/* Test populating the application information structure using an
Expand Down Expand Up @@ -3862,7 +3862,7 @@ void TestAPI(void)
ES_ResetUnitTest();
ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, &UtTaskRecPtr);
TaskId = CFE_ES_TaskRecordGetID(UtTaskRecPtr);
UT_Report(__FILE__, __LINE__, CFE_ES_GetTaskInfo(NULL, TaskId) == CFE_ES_ERR_BUFFER, "CFE_ES_GetTaskInfo",
UT_Report(__FILE__, __LINE__, CFE_ES_GetTaskInfo(NULL, TaskId) == CFE_ES_BAD_ARGUMENT, "CFE_ES_GetTaskInfo",
"Get task info by ID; NULL buffer");

/* Test getting task information using the task ID - bad task ID */
Expand Down
2 changes: 1 addition & 1 deletion modules/evs/fsw/src/cfe_evs.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int32 CFE_EVS_Register(const void *Filters, uint16 NumEventFilters, uint16 Filte
}
else if ((NumEventFilters != 0) && (Filters == NULL))
{
Status = CFE_ES_ERR_BUFFER;
Status = CFE_ES_BAD_ARGUMENT;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion modules/evs/ut-coverage/evs_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2038,7 +2038,7 @@ void Test_Misc(void)

/* Test registering an application with invalid filter argument */
UT_InitData();
UT_Report(__FILE__, __LINE__, CFE_EVS_Register(NULL, 1, 0) == CFE_ES_ERR_BUFFER, "CFE_EVS_Register",
UT_Report(__FILE__, __LINE__, CFE_EVS_Register(NULL, 1, 0) == CFE_ES_BAD_ARGUMENT, "CFE_EVS_Register",
"Register application with invalid arguments");

/* Test housekeeping report with log disabled */
Expand Down
2 changes: 1 addition & 1 deletion modules/resourceid/fsw/src/cfe_resourceid_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int32 CFE_ResourceId_ToIndex(CFE_ResourceId_t Id, uint32 BaseValue, uint32 Table

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

Serial = CFE_ResourceId_ToInteger(Id) - BaseValue;
Expand Down
2 changes: 1 addition & 1 deletion modules/resourceid/ut-coverage/test_cfe_resourceid.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void TestResourceID(void)
UtAssert_True(CFE_ResourceId_Equal(Id, CFE_RESOURCEID_UNDEFINED), "CFE_ResourceId_FindNext() bad input: id=%lx",
CFE_ResourceId_ToInteger(Id));

UtAssert_INT32_EQ(CFE_ResourceId_ToIndex(Id, RefBase, 1, NULL), CFE_ES_ERR_BUFFER);
UtAssert_INT32_EQ(CFE_ResourceId_ToIndex(Id, RefBase, 1, NULL), CFE_ES_BAD_ARGUMENT);
UtAssert_INT32_EQ(CFE_ResourceId_ToIndex(Id, RefBase, 0, &TestIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
UtAssert_INT32_EQ(CFE_ResourceId_ToIndex(Id, ~RefBase, 1, &TestIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID);
}
Expand Down

0 comments on commit db39522

Please sign in to comment.