Skip to content

Commit 56394ae

Browse files
authored
Merge pull request #232 from nasa/fix-231-to-lab-use-of-strcpy
Fix #231, to_lab app: strcpy() does not check bound.
2 parents c757665 + 6a97c47 commit 56394ae

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

fsw/src/to_lab_app.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,6 @@ void TO_LAB_delete_callback(void)
116116
CFE_Status_t TO_LAB_init(void)
117117
{
118118
CFE_Status_t status;
119-
char PipeName[16];
120-
uint16 PipeDepth;
121-
char ToTlmPipeName[16];
122-
uint16 ToTlmPipeDepth;
123119
void *TblPtr;
124120
char VersionString[TO_LAB_CFG_MAX_VERSION_STR_LEN];
125121

@@ -128,10 +124,6 @@ CFE_Status_t TO_LAB_init(void)
128124

129125
TO_LAB_Global.AllowPassthru = true;
130126
TO_LAB_Global.downlink_on = false;
131-
PipeDepth = TO_LAB_PLATFORM_CMD_PIPE_DEPTH;
132-
strcpy(PipeName, "TO_LAB_CMD_PIPE");
133-
ToTlmPipeDepth = TO_LAB_PLATFORM_TLM_PIPE_DEPTH;
134-
strcpy(ToTlmPipeName, "TO_LAB_TLM_PIPE");
135127

136128
/*
137129
** Register with EVS
@@ -200,7 +192,7 @@ CFE_Status_t TO_LAB_init(void)
200192
TO_LAB_Global.SubsTblPtr = TblPtr; /* Save returned address */
201193

202194
/* Subscribe to my commands */
203-
status = CFE_SB_CreatePipe(&TO_LAB_Global.Cmd_pipe, PipeDepth, PipeName);
195+
status = CFE_SB_CreatePipe(&TO_LAB_Global.Cmd_pipe, TO_LAB_PLATFORM_CMD_PIPE_DEPTH, "TO_LAB_CMD_PIPE");
204196
if (status != CFE_SUCCESS)
205197
{
206198
CFE_EVS_SendEvent(TO_LAB_CR_PIPE_ERR_EID,
@@ -224,7 +216,7 @@ CFE_Status_t TO_LAB_init(void)
224216
if (status == CFE_SUCCESS)
225217
{
226218
/* Create TO TLM pipe */
227-
status = CFE_SB_CreatePipe(&TO_LAB_Global.Tlm_pipe, ToTlmPipeDepth, ToTlmPipeName);
219+
status = CFE_SB_CreatePipe(&TO_LAB_Global.Tlm_pipe, TO_LAB_PLATFORM_TLM_PIPE_DEPTH, "TO_LAB_TLM_PIPE");
228220
if (status != CFE_SUCCESS)
229221
{
230222
CFE_EVS_SendEvent(TO_LAB_TLMPIPE_ERR_EID,

0 commit comments

Comments
 (0)