diff --git a/fsw/cfe-core/src/es/cfe_es_api.c b/fsw/cfe-core/src/es/cfe_es_api.c index d4d639de1..a89335b73 100644 --- a/fsw/cfe-core/src/es/cfe_es_api.c +++ b/fsw/cfe-core/src/es/cfe_es_api.c @@ -871,7 +871,7 @@ int32 CFE_ES_GetAppName(char *AppName, CFE_ES_ResourceID_t AppId, size_t BufferL */ if (CFE_ES_AppRecordIsMatch(AppRecPtr, AppId)) { - strncpy(AppName, CFE_ES_AppRecordGetName(AppRecPtr), BufferLength); + strncpy(AppName, CFE_ES_AppRecordGetName(AppRecPtr), BufferLength - 1); AppName[BufferLength - 1] = '\0'; Result = CFE_SUCCESS; } @@ -1306,8 +1306,8 @@ int32 CFE_ES_CreateChildTask(CFE_ES_ResourceID_t *TaskIdPtr, CFE_ES_TaskRecordSetUsed(TaskRecPtr, ChildTaskId); TaskRecPtr->AppId = CFE_ES_AppRecordGetID(AppRecPtr); - strncpy((char *)TaskRecPtr->TaskName,TaskName,OS_MAX_API_NAME); - TaskRecPtr->TaskName[OS_MAX_API_NAME - 1] = '\0'; + strncpy(TaskRecPtr->TaskName,TaskName,sizeof(TaskRecPtr->TaskName) - 1); + TaskRecPtr->TaskName[sizeof(TaskRecPtr->TaskName) - 1] = '\0'; CFE_ES_Global.RegisteredTasks++; *TaskIdPtr = ChildTaskId; @@ -1737,8 +1737,8 @@ int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, size_t BlockSize, con /* Perform a buffer overrun safe copy of name for debug log message */ - strncpy(CDSName, Name, CFE_MISSION_ES_CDS_MAX_NAME_LENGTH); - CDSName[CFE_MISSION_ES_CDS_MAX_NAME_LENGTH-1] = '\0'; + strncpy(CDSName, Name, sizeof(CDSName) - 1); + CDSName[sizeof(CDSName) - 1] = '\0'; CFE_ES_WriteToSysLog("CFE_CDS:Register-CDS Name (%s) is too long\n", CDSName); } else @@ -1923,7 +1923,8 @@ int32 CFE_ES_RegisterGenCounter(CFE_ES_ResourceID_t *CounterIdPtr, const char *C else { strncpy(CountRecPtr->CounterName,CounterName, - sizeof(CountRecPtr->CounterName)); + sizeof(CountRecPtr->CounterName) - 1); + CountRecPtr->CounterName,CounterName[sizeof(CountRecPtr->CounterName) - 1] = '\0'; CountRecPtr->Counter = 0; CFE_ES_CounterRecordSetUsed(CountRecPtr, PendingCounterId); CFE_ES_Global.LastCounterId = PendingCounterId; diff --git a/fsw/cfe-core/src/es/cfe_es_apps.c b/fsw/cfe-core/src/es/cfe_es_apps.c index c38ee545f..bd1a5e238 100644 --- a/fsw/cfe-core/src/es/cfe_es_apps.c +++ b/fsw/cfe-core/src/es/cfe_es_apps.c @@ -707,12 +707,16 @@ int32 CFE_ES_AppCreate(CFE_ES_ResourceID_t *ApplicationIdPtr, AppRecPtr->Type = CFE_ES_AppType_EXTERNAL; strncpy(AppRecPtr->StartParams.BasicInfo.Name, AppName, sizeof(AppRecPtr->StartParams.BasicInfo.Name)-1); + AppRecPtr->StartParams.BasicInfo.Name[sizeof(AppRecPtr->StartParams.BasicInfo.Name)-1] = '\0'; strncpy(AppRecPtr->StartParams.BasicInfo.FileName, FileName, sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1); + AppRecPtr->StartParams.BasicInfo.FileName[sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1] = '\0'; if (EntryPointName != NULL && strcmp(EntryPointName, "NULL") != 0) { strncpy(AppRecPtr->StartParams.BasicInfo.EntryPoint, EntryPointName, sizeof(AppRecPtr->StartParams.BasicInfo.EntryPoint)-1); + AppRecPtr->StartParams.BasicInfo.EntryPoint[ + sizeof(AppRecPtr->StartParams.BasicInfo.EntryPoint)-1] = '\0'; } AppRecPtr->StartParams.StackSize = StackSize; @@ -882,12 +886,15 @@ int32 CFE_ES_LoadLibrary(CFE_ES_ResourceID_t *LibraryIdPtr, */ strncpy(LibSlotPtr->BasicInfo.Name, LibName, sizeof(LibSlotPtr->BasicInfo.Name)-1); + LibSlotPtr->BasicInfo.Name[sizeof(LibSlotPtr->BasicInfo.Name)-1] = '\0'; strncpy(LibSlotPtr->BasicInfo.FileName, FileName, sizeof(LibSlotPtr->BasicInfo.FileName)-1); + LibSlotPtr->BasicInfo.FileName[sizeof(LibSlotPtr->BasicInfo.FileName)-1] = '\0'; if (EntryPointName != NULL && strcmp(EntryPointName, "NULL") != 0) { strncpy(LibSlotPtr->BasicInfo.EntryPoint, EntryPointName, sizeof(LibSlotPtr->BasicInfo.EntryPoint)-1); + LibSlotPtr->BasicInfo.EntryPoint[sizeof(LibSlotPtr->BasicInfo.EntryPoint)-1] = '\0'; } CFE_ES_LibRecordSetUsed(LibSlotPtr, CFE_ES_RESOURCEID_RESERVED); diff --git a/fsw/cfe-core/src/es/cfe_es_erlog.c b/fsw/cfe-core/src/es/cfe_es_erlog.c index c7cafdf01..4a49a8b38 100644 --- a/fsw/cfe-core/src/es/cfe_es_erlog.c +++ b/fsw/cfe-core/src/es/cfe_es_erlog.c @@ -139,7 +139,8 @@ int32 CFE_ES_WriteToERLogWithContext( CFE_ES_LogEntryType_Enum_t EntryType, ui /* ** Copy the Description string to the log. */ - strncpy(EntryPtr->BaseInfo.Description, Description, sizeof(EntryPtr->BaseInfo.Description)); + strncpy(EntryPtr->BaseInfo.Description, Description, sizeof(EntryPtr->BaseInfo.Description) - 1); + EntryPtr->BaseInfo.Description[sizeof(EntryPtr->BaseInfo.Description) - 1] = '\0'; /* * Store the context info (if any) diff --git a/fsw/cfe-core/src/es/cfe_es_start.c b/fsw/cfe-core/src/es/cfe_es_start.c index 2a883ef13..11edd2dd8 100644 --- a/fsw/cfe-core/src/es/cfe_es_start.c +++ b/fsw/cfe-core/src/es/cfe_es_start.c @@ -781,6 +781,7 @@ void CFE_ES_CreateObjects(void) AppRecPtr->Type = CFE_ES_AppType_CORE; strncpy(AppRecPtr->StartParams.BasicInfo.Name, CFE_ES_ObjectTable[i].ObjectName, sizeof(AppRecPtr->StartParams.BasicInfo.Name)-1); + AppRecPtr->StartParams.BasicInfo.Name[sizeof(AppRecPtr->StartParams.BasicInfo.Name)-1] = '\0'; /* FileName and EntryPoint is not valid for core apps */ AppRecPtr->StartParams.StackSize = CFE_ES_ObjectTable[i].ObjectSize; diff --git a/fsw/cfe-core/src/es/cfe_es_task.c b/fsw/cfe-core/src/es/cfe_es_task.c index c852c7614..6fcf2b041 100644 --- a/fsw/cfe-core/src/es/cfe_es_task.c +++ b/fsw/cfe-core/src/es/cfe_es_task.c @@ -216,15 +216,6 @@ int32 CFE_ES_TaskInit(void) CFE_ES_TaskData.CommandCounter = 0; CFE_ES_TaskData.CommandErrorCounter = 0; - /* - ** Initialize task configuration data - */ - strcpy(CFE_ES_TaskData.PipeName, "ES_CMD_PIPE"); - CFE_ES_TaskData.PipeDepth = 12; - - CFE_ES_TaskData.LimitHK = 2; - CFE_ES_TaskData.LimitCmd = 4; - /* ** Initialize systemlog to default Power On or Processor Reset mode */ @@ -271,7 +262,7 @@ int32 CFE_ES_TaskInit(void) /* ** Create Software Bus message pipe */ - Status = CFE_SB_CreatePipe(&CFE_ES_TaskData.CmdPipe, CFE_ES_TaskData.PipeDepth, CFE_ES_TaskData.PipeName); + Status = CFE_SB_CreatePipe(&CFE_ES_TaskData.CmdPipe, CFE_ES_PIPE_DEPTH, CFE_ES_PIPE_NAME); if ( Status != CFE_SUCCESS ) { CFE_ES_WriteToSysLog("ES:Cannot Create SB Pipe, RC = 0x%08X\n", (unsigned int)Status); @@ -282,7 +273,7 @@ int32 CFE_ES_TaskInit(void) ** Subscribe to Housekeeping request commands */ Status = CFE_SB_SubscribeEx(CFE_SB_ValueToMsgId(CFE_ES_SEND_HK_MID), CFE_ES_TaskData.CmdPipe, - CFE_SB_Default_Qos, CFE_ES_TaskData.LimitHK); + CFE_SB_Default_Qos, CFE_ES_LIMIT_HK); if ( Status != CFE_SUCCESS ) { CFE_ES_WriteToSysLog("ES:Cannot Subscribe to HK packet, RC = 0x%08X\n", (unsigned int)Status); @@ -293,7 +284,7 @@ int32 CFE_ES_TaskInit(void) ** Subscribe to ES task ground command packets */ Status = CFE_SB_SubscribeEx(CFE_SB_ValueToMsgId(CFE_ES_CMD_MID), CFE_ES_TaskData.CmdPipe, - CFE_SB_Default_Qos, CFE_ES_TaskData.LimitCmd); + CFE_SB_Default_Qos, CFE_ES_LIMIT_CMD); if ( Status != CFE_SUCCESS ) { CFE_ES_WriteToSysLog("ES:Cannot Subscribe to ES ground commands, RC = 0x%08X\n", (unsigned int)Status); diff --git a/fsw/cfe-core/src/es/cfe_es_task.h b/fsw/cfe-core/src/es/cfe_es_task.h index 22270cc50..9b6476c0c 100644 --- a/fsw/cfe-core/src/es/cfe_es_task.h +++ b/fsw/cfe-core/src/es/cfe_es_task.h @@ -47,6 +47,11 @@ /*************************************************************************/ +#define CFE_ES_PIPE_NAME "ES_CMD_PIPE" +#define CFE_ES_PIPE_DEPTH 12 +#define CFE_ES_LIMIT_HK 2 +#define CFE_ES_LIMIT_CMD 4 + /* ** ES File descriptions */ @@ -123,9 +128,6 @@ typedef struct /* ** ES Task initialization data (not reported in housekeeping) */ - char PipeName[OS_MAX_API_NAME]; - uint16 PipeDepth; - uint8 LimitHK; uint8 LimitCmd; diff --git a/fsw/cfe-core/src/sb/cfe_sb_priv.c b/fsw/cfe-core/src/sb/cfe_sb_priv.c index 80ba52c2b..39016859c 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_priv.c +++ b/fsw/cfe-core/src/sb/cfe_sb_priv.c @@ -412,10 +412,10 @@ char *CFE_SB_GetAppTskName(CFE_ES_ResourceID_t TaskId,char *FullName){ }else{ /* AppName and TskName buffers and strncpy are needed to limit string sizes */ - strncpy(AppName,(char *)ptr->AppName,OS_MAX_API_NAME-1); - AppName[OS_MAX_API_NAME-1] = '\0'; - strncpy(TskName,(char *)ptr->TaskName,OS_MAX_API_NAME-1); - TskName[OS_MAX_API_NAME-1] = '\0'; + strncpy(AppName,(char *)ptr->AppName,sizeof(AppName)-1); + AppName[sizeof(AppName)-1] = '\0'; + strncpy(TskName,(char *)ptr->TaskName,sizeof(TskName)-1); + TskName[sizeof(TskName)-1] = '\0'; sprintf(FullName,"%s.%s",AppName,TskName); diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_api.c b/fsw/cfe-core/src/tbl/cfe_tbl_api.c index 7d261ec31..3c5675541 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_api.c +++ b/fsw/cfe-core/src/tbl/cfe_tbl_api.c @@ -81,8 +81,8 @@ int32 CFE_TBL_Register( CFE_TBL_Handle_t *TblHandlePtr, Status = CFE_TBL_ERR_INVALID_NAME; /* Perform a buffer overrun safe copy of name for debug log message */ - strncpy(TblName, Name, CFE_MISSION_TBL_MAX_NAME_LENGTH); - TblName[CFE_MISSION_TBL_MAX_NAME_LENGTH-1] = '\0'; + strncpy(TblName, Name, sizeof(TblName) - 1); + TblName[sizeof(TblName) - 1] = '\0'; CFE_ES_WriteToSysLog("CFE_TBL:Register-Table Name (%s) is bad length (%d)",TblName,(int)NameLen); } else @@ -314,7 +314,8 @@ int32 CFE_TBL_Register( CFE_TBL_Handle_t *TblHandlePtr, RegRecPtr->ValidationFuncPtr = TblValidationFuncPtr; /* Save Table Name in Registry */ - strncpy(RegRecPtr->Name, TblName, CFE_TBL_MAX_FULL_NAME_LEN); + strncpy(RegRecPtr->Name, TblName, sizeof(RegRecPtr->Name) - 1); + RegRecPtr->Name[sizeof(RegRecPtr->Name) - 1] = '\0'; /* Set the "Dump Only" flag to value based upon selected option */ if ((TblOptionFlags & CFE_TBL_OPT_LD_DMP_MSK) == CFE_TBL_OPT_DUMP_ONLY) @@ -398,10 +399,14 @@ int32 CFE_TBL_Register( CFE_TBL_Handle_t *TblHandlePtr, if ((CritRegRecPtr != NULL) && (CritRegRecPtr->TableLoadedOnce)) { - strncpy(WorkingBufferPtr->DataSource, CritRegRecPtr->LastFileLoaded, OS_MAX_PATH_LEN); + strncpy(WorkingBufferPtr->DataSource, CritRegRecPtr->LastFileLoaded, + sizeof(WorkingBufferPtr->DataSource) - 1); + WorkingBufferPtr->DataSource[sizeof(WorkingBufferPtr->DataSource) - 1] = '\0'; WorkingBufferPtr->FileCreateTimeSecs = CritRegRecPtr->FileCreateTimeSecs; WorkingBufferPtr->FileCreateTimeSubSecs = CritRegRecPtr->FileCreateTimeSubSecs; - strncpy(RegRecPtr->LastFileLoaded, CritRegRecPtr->LastFileLoaded, OS_MAX_PATH_LEN); + strncpy(RegRecPtr->LastFileLoaded, CritRegRecPtr->LastFileLoaded, + sizeof(RegRecPtr->LastFileLoaded) - 1); + RegRecPtr->LastFileLoaded[sizeof(RegRecPtr->LastFileLoaded) - 1] = '\0'; RegRecPtr->TimeOfLastUpdate.Seconds = CritRegRecPtr->TimeOfLastUpdate.Seconds; RegRecPtr->TimeOfLastUpdate.Subseconds = CritRegRecPtr->TimeOfLastUpdate.Subseconds; RegRecPtr->TableLoadedOnce = CritRegRecPtr->TableLoadedOnce; @@ -441,7 +446,8 @@ int32 CFE_TBL_Register( CFE_TBL_Handle_t *TblHandlePtr, if (CritRegRecPtr != NULL) { CritRegRecPtr->CDSHandle = RegRecPtr->CDSHandle; - strncpy(CritRegRecPtr->Name, TblName, CFE_TBL_MAX_FULL_NAME_LEN); + strncpy(CritRegRecPtr->Name, TblName, sizeof(CritRegRecPtr->Name) - 1); + CritRegRecPtr->Name[sizeof(CritRegRecPtr->Name) - 1] = '\0'; CritRegRecPtr->FileCreateTimeSecs = 0; CritRegRecPtr->FileCreateTimeSubSecs = 0; CritRegRecPtr->LastFileLoaded[0] = '\0'; @@ -874,7 +880,8 @@ int32 CFE_TBL_Load( CFE_TBL_Handle_t TblHandle, /* On initial loads, make sure registry is given file/address of data source */ strncpy(RegRecPtr->LastFileLoaded, WorkingBufferPtr->DataSource, - OS_MAX_PATH_LEN); + sizeof(RegRecPtr->LastFileLoaded) - 1); + RegRecPtr->LastFileLoaded[sizeof(RegRecPtr->LastFileLoaded) - 1] = '\0'; CFE_TBL_NotifyTblUsersOfUpdate(RegRecPtr); @@ -1494,7 +1501,7 @@ int32 CFE_TBL_Modified( CFE_TBL_Handle_t TblHandle ) /* Keep a record of change for the ground operators reference */ RegRecPtr->TimeOfLastUpdate = CFE_TIME_GetTime(); - RegRecPtr->LastFileLoaded[OS_MAX_PATH_LEN-1] = '\0'; + RegRecPtr->LastFileLoaded[sizeof(RegRecPtr->LastFileLoaded)-1] = '\0'; /* Update CRC on contents of table */ RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].Crc = @@ -1504,13 +1511,13 @@ int32 CFE_TBL_Modified( CFE_TBL_Handle_t TblHandle ) CFE_MISSION_ES_DEFAULT_CRC); FilenameLen = strlen(RegRecPtr->LastFileLoaded); - if (FilenameLen < (OS_MAX_PATH_LEN-4)) + if (FilenameLen < (sizeof(RegRecPtr->LastFileLoaded)-4)) { strncpy(&RegRecPtr->LastFileLoaded[FilenameLen], "(*)", 4); } else { - strncpy(&RegRecPtr->LastFileLoaded[(OS_MAX_PATH_LEN-4)], "(*)", 4); + strncpy(&RegRecPtr->LastFileLoaded[sizeof(RegRecPtr->LastFileLoaded)-4], "(*)", 4); } AccessIterator = RegRecPtr->HeadOfAccessList; diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_internal.c b/fsw/cfe-core/src/tbl/cfe_tbl_internal.c index 2ec3cf6e7..afaae8f5a 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_internal.c +++ b/fsw/cfe-core/src/tbl/cfe_tbl_internal.c @@ -1002,8 +1002,8 @@ int32 CFE_TBL_LoadFromFile(const char *AppName, CFE_TBL_LoadBuff_t *WorkingBuffe return CFE_TBL_ERR_FILE_TOO_LARGE; } - memset(WorkingBufferPtr->DataSource, 0, OS_MAX_PATH_LEN); - strncpy(WorkingBufferPtr->DataSource, Filename, OS_MAX_PATH_LEN); + memset(WorkingBufferPtr->DataSource, 0, sizeof(WorkingBufferPtr->DataSource)); + strncpy(WorkingBufferPtr->DataSource, Filename, sizeof(WorkingBufferPtr->DataSource) - 1); /* Save file creation time for later storage into Registry */ WorkingBufferPtr->FileCreateTimeSecs = StdFileHeader.TimeSeconds; @@ -1054,7 +1054,8 @@ int32 CFE_TBL_UpdateInternal( CFE_TBL_Handle_t TblHandle, /* However, we need to copy it into active registry area */ strncpy(RegRecPtr->LastFileLoaded, RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].DataSource, - OS_MAX_PATH_LEN); + sizeof(RegRecPtr->LastFileLoaded) - 1); + RegRecPtr->LastFileLoaded[sizeof(RegRecPtr->LastFileLoaded) - 1] = '\0'; CFE_TBL_NotifyTblUsersOfUpdate(RegRecPtr); @@ -1470,7 +1471,8 @@ void CFE_TBL_UpdateCriticalTblCDS(CFE_TBL_RegistryRec_t *RegRecPtr) /* Save information related to the source of the data stored in the table in Critical Table Registry */ CritRegRecPtr->FileCreateTimeSecs = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileCreateTimeSecs; CritRegRecPtr->FileCreateTimeSubSecs = RegRecPtr->Buffers[RegRecPtr->ActiveBufferIndex].FileCreateTimeSubSecs; - strncpy(CritRegRecPtr->LastFileLoaded, RegRecPtr->LastFileLoaded, OS_MAX_PATH_LEN); + strncpy(CritRegRecPtr->LastFileLoaded, RegRecPtr->LastFileLoaded, sizeof(CritRegRecPtr->LastFileLoaded) - 1); + CritRegRecPtr->LastFileLoaded[sizeof(CritRegRecPtr->LastFileLoaded) - 1] = '\0'; CritRegRecPtr->TimeOfLastUpdate = RegRecPtr->TimeOfLastUpdate; CritRegRecPtr->TableLoadedOnce = RegRecPtr->TableLoadedOnce; diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task.c b/fsw/cfe-core/src/tbl/cfe_tbl_task.c index efea646f4..635ffd63b 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task.c +++ b/fsw/cfe-core/src/tbl/cfe_tbl_task.c @@ -181,9 +181,7 @@ int32 CFE_TBL_TaskInit(void) /* ** Create Software Bus message pipe */ - Status = CFE_SB_CreatePipe(&CFE_TBL_TaskData.CmdPipe, - CFE_TBL_TaskData.PipeDepth, - CFE_TBL_TaskData.PipeName); + Status = CFE_SB_CreatePipe(&CFE_TBL_TaskData.CmdPipe, CFE_TBL_TASK_PIPE_DEPTH, CFE_TBL_TASK_PIPE_NAME); if(Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("TBL:Error creating cmd pipe:RC=0x%08X\n",(unsigned int)Status); @@ -241,10 +239,6 @@ void CFE_TBL_InitData(void) /* Get the assigned Application ID for the Table Services Task */ CFE_ES_GetAppID(&CFE_TBL_TaskData.TableTaskAppId); - /* Initialize Command Pipe Parameters */ - CFE_TBL_TaskData.PipeDepth = CFE_TBL_TASK_PIPE_DEPTH; - strncpy(CFE_TBL_TaskData.PipeName, CFE_TBL_TASK_PIPE_NAME, 16); - /* Initialize Packet Headers */ CFE_MSG_Init(&CFE_TBL_TaskData.HkPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_TBL_HK_TLM_MID), diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task.h b/fsw/cfe-core/src/tbl/cfe_tbl_task.h index 4e0f8fa2f..e2a41205b 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task.h +++ b/fsw/cfe-core/src/tbl/cfe_tbl_task.h @@ -313,8 +313,6 @@ typedef struct /* ** Task initialization data (not reported in housekeeping)... */ - char PipeName[16]; /**< \brief Contains name of Table Task command pipe */ - uint16 PipeDepth; /**< \brief Contains depth of Table Task command pipe */ CFE_ES_ResourceID_t TableTaskAppId; /**< \brief Contains Table Task Application ID as assigned by OS AL */ int16 HkTlmTblRegIndex; /**< \brief Index of table registry entry to be telemetered with Housekeeping */ diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c b/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c index 32b286873..21bd4e025 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c +++ b/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c @@ -484,9 +484,13 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data) /* Save file information statistics for housekeeping telemetry */ strncpy(CFE_TBL_TaskData.HkPacket.Payload.LastFileLoaded, LoadFilename, - sizeof(CFE_TBL_TaskData.HkPacket.Payload.LastFileLoaded)); + sizeof(CFE_TBL_TaskData.HkPacket.Payload.LastFileLoaded) - 1); + CFE_TBL_TaskData.HkPacket.Payload.LastFileLoaded[ + sizeof(CFE_TBL_TaskData.HkPacket.Payload.LastFileLoaded) - 1] = '\0'; strncpy(CFE_TBL_TaskData.HkPacket.Payload.LastTableLoaded, TblFileHeader.TableName, - sizeof(CFE_TBL_TaskData.HkPacket.Payload.LastTableLoaded)); + sizeof(CFE_TBL_TaskData.HkPacket.Payload.LastTableLoaded) - 1); + CFE_TBL_TaskData.HkPacket.Payload.LastTableLoaded[ + sizeof(CFE_TBL_TaskData.HkPacket.Payload.LastTableLoaded) - 1] = '\0'; /* Increment successful command completion counter */ ReturnCode = CFE_TBL_INC_CMD_CTR; diff --git a/fsw/cfe-core/src/time/cfe_time_task.c b/fsw/cfe-core/src/time/cfe_time_task.c index 702525bcd..ee81746d6 100644 --- a/fsw/cfe-core/src/time/cfe_time_task.c +++ b/fsw/cfe-core/src/time/cfe_time_task.c @@ -265,9 +265,7 @@ int32 CFE_TIME_TaskInit(void) }/* end if */ - Status = CFE_SB_CreatePipe(&CFE_TIME_TaskData.CmdPipe, - CFE_TIME_TaskData.PipeDepth, - CFE_TIME_TaskData.PipeName); + Status = CFE_SB_CreatePipe(&CFE_TIME_TaskData.CmdPipe, CFE_TIME_TASK_PIPE_DEPTH, CFE_TIME_TASK_PIPE_NAME); if(Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("TIME:Error creating cmd pipe:RC=0x%08X\n",(unsigned int)Status); diff --git a/fsw/cfe-core/src/time/cfe_time_utils.c b/fsw/cfe-core/src/time/cfe_time_utils.c index aeaeebeef..a0ff61d8c 100644 --- a/fsw/cfe-core/src/time/cfe_time_utils.c +++ b/fsw/cfe-core/src/time/cfe_time_utils.c @@ -256,9 +256,6 @@ void CFE_TIME_InitData(void) /* ** Initialize task configuration data... */ - strcpy(CFE_TIME_TaskData.PipeName, CFE_TIME_TASK_PIPE_NAME); - CFE_TIME_TaskData.PipeDepth = CFE_TIME_TASK_PIPE_DEPTH; - memset((void*)CFE_TIME_TaskData.ReferenceState, 0, sizeof(CFE_TIME_TaskData.ReferenceState)); for (i = 0; i < CFE_TIME_REFERENCE_BUF_DEPTH; ++i) { diff --git a/fsw/cfe-core/src/time/cfe_time_utils.h b/fsw/cfe-core/src/time/cfe_time_utils.h index e5ee2267c..84a4c4f0d 100644 --- a/fsw/cfe-core/src/time/cfe_time_utils.h +++ b/fsw/cfe-core/src/time/cfe_time_utils.h @@ -188,9 +188,6 @@ typedef struct /* ** Task initialization data (not reported in housekeeping)... */ - char PipeName[16]; - uint16 PipeDepth; - int16 ClockSource; int16 ClockSignal; int16 ServerFlyState;