Skip to content

Commit

Permalink
Fix #83, Adds null termination to software bus messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
jdfiguer authored and jdfiguer committed Mar 7, 2023
1 parent 04c0154 commit 5e0a1d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fsw/src/ds_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,8 @@ void DS_CmdSetDestPath(const CFE_SB_Buffer_t *BufPtr)
** Set path portion of destination table filename...
*/
pDest = &DS_AppData.DestFileTblPtr->File[DS_DestPathCmd->FileTableIndex];
strncpy(pDest->Pathname, DS_DestPathCmd->Pathname, sizeof(pDest->Pathname));
CFE_SB_MessageStringGet(pDest->Pathname, DS_DestPathCmd->Pathname, NULL, sizeof(pDest->Pathname),
sizeof(DS_DestPathCmd->Pathname));

/*
** Notify cFE that we have modified the table data...
Expand Down Expand Up @@ -806,7 +807,8 @@ void DS_CmdSetDestBase(const CFE_SB_Buffer_t *BufPtr)
** Set base portion of destination table filename...
*/
pDest = &DS_AppData.DestFileTblPtr->File[DS_DestBaseCmd->FileTableIndex];
strncpy(pDest->Basename, DS_DestBaseCmd->Basename, sizeof(pDest->Basename));
CFE_SB_MessageStringGet(pDest->Basename, DS_DestBaseCmd->Basename, NULL, sizeof(pDest->Basename),
sizeof(DS_DestBaseCmd->Basename));

/*
** Notify cFE that we have modified the table data...
Expand Down Expand Up @@ -873,7 +875,8 @@ void DS_CmdSetDestExt(const CFE_SB_Buffer_t *BufPtr)
** Set extension portion of destination table filename...
*/
pDest = &DS_AppData.DestFileTblPtr->File[DS_DestExtCmd->FileTableIndex];
strncpy(pDest->Extension, DS_DestExtCmd->Extension, sizeof(pDest->Extension));
CFE_SB_MessageStringGet(pDest->Extension, DS_DestExtCmd->Extension, NULL, sizeof(pDest->Extension),
sizeof(DS_DestExtCmd->Extension));

/*
** Notify cFE that we have modified the table data...
Expand Down

0 comments on commit 5e0a1d9

Please sign in to comment.