From c60c73ff96dc2e52b87eaa873874e981c6117f87 Mon Sep 17 00:00:00 2001 From: Walker Date: Wed, 15 Jul 2026 12:08:42 -0500 Subject: [PATCH] Fix #146, Add Null Terminator for FileName in FM_GetDirListFileCmd --- fsw/src/fm_cmds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fsw/src/fm_cmds.c b/fsw/src/fm_cmds.c index 1cb8440..67c0d3b 100644 --- a/fsw/src/fm_cmds.c +++ b/fsw/src/fm_cmds.c @@ -736,7 +736,8 @@ CFE_Status_t FM_GetDirListFileCmd(const FM_GetDirListFileCmd_t *Msg) } else { - memcpy(Filename, CmdPtr->OutputFilePath, sizeof(Filename)); + strncpy(Filename, CmdPtr->OutputFilePath, sizeof(Filename) - 1); + Filename[sizeof(Filename) - 1] = '\0'; } /* Note: it is OK for this file to overwrite a previous version of the file */