Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/cfe_assert/src/cfe_assert_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int32 CFE_Assert_OpenLogFile(const char *Filename)
{
NameLen = sizeof(CFE_Assert_Global.LogFileTemp) - 5;
}
strcpy(&CFE_Assert_Global.LogFileTemp[NameLen], ".tmp");
memcpy(&CFE_Assert_Global.LogFileTemp[NameLen], ".tmp", sizeof(".tmp"));

OsStatus = OS_OpenCreate(&CFE_Assert_Global.LogFileDesc,
CFE_Assert_Global.LogFileTemp,
Expand Down
2 changes: 1 addition & 1 deletion modules/tbl/fsw/src/cfe_tbl_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ void CFE_TBL_MarkNameAsModified(char *NameBufPtr, size_t NameBufSize)
EndPtr = &NameBufPtr[NameBufSize - 4];
}

strcpy(EndPtr, "(*)");
memcpy(EndPtr, "(*)", sizeof("(*)"));
}

/*----------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions modules/time/fsw/src/cfe_time_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,13 @@ CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint)
}

time_t sec = TimeToPrint.Seconds + CFE_MISSION_TIME_EPOCH_SECONDS; // epoch is Jan 1, 1980

/* gmtime_r returns NULL for times outside the representable range.
* Zero-initialise tm so strftime produces a defined (epoch) string
* rather than reading uninitialised stack memory. */
memset(&tm, 0, sizeof(tm));
gmtime_r(&sec, &tm);

FmtLen = strftime(PrintBuffer, CFE_TIME_PRINTED_STRING_SIZE - 6, "%Y-%j-%H:%M:%S", &tm);
PrintBuffer += FmtLen;
*(PrintBuffer++) = '.';
Expand Down
Loading