From 33d7df9ba5d81a6ba74b657500b6a39f7656f6ef Mon Sep 17 00:00:00 2001 From: jdfiguer Date: Wed, 8 Mar 2023 13:49:15 -0500 Subject: [PATCH] Fix #62, Adds null termination to table name processing --- fsw/src/cs_table_processing.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fsw/src/cs_table_processing.c b/fsw/src/cs_table_processing.c index d2f754c..43c6d6a 100644 --- a/fsw/src/cs_table_processing.c +++ b/fsw/src/cs_table_processing.c @@ -694,7 +694,8 @@ void CS_ProcessNewTablesDefinitionTable(const CS_Def_Tables_Table_Entry_t *Defin ResultsEntry->StartAddress = 0; /* this is unknown at this time */ ResultsEntry->TblHandle = TableHandle; ResultsEntry->IsCSOwner = Owned; - strncpy(ResultsEntry->Name, DefEntry->Name, CFE_TBL_MAX_FULL_NAME_LEN); + CFE_SB_MessageStringGet(ResultsEntry->Name, DefEntry->Name, NULL, sizeof(ResultsEntry->Name), + sizeof(DefEntry->Name)); } else { @@ -765,7 +766,8 @@ void CS_ProcessNewAppDefinitionTable(const CS_Def_App_Table_Entry_t *DefinitionT ResultsEntry->ByteOffset = 0; ResultsEntry->TempChecksumValue = 0; ResultsEntry->StartAddress = 0; /* this is unknown at this time */ - strncpy(ResultsEntry->Name, DefEntry->Name, OS_MAX_API_NAME); + CFE_SB_MessageStringGet(ResultsEntry->Name, DefEntry->Name, NULL, sizeof(ResultsEntry->Name), + sizeof(DefEntry->Name)); } else {