Skip to content

Commit 258625f

Browse files
authored
Merge pull request #1109 from nasa/integration-candidate
cFE Integration candidate: 2021-01-19
2 parents c7363c8 + f221911 commit 258625f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3154
-2116
lines changed

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,40 @@ The detailed cFE user's guide can be viewed at <https://github.com/nasa/cFS/blob
1010

1111
## Version History
1212

13+
### Development Build: 6.8.0-rc1+dev288
14+
15+
- Documentation: Add Security.md with instructions to report vulnerability
16+
- Documentation: Update cpuname/MISSION_CPUNAMES documentation
17+
- Fixes `UT_CheckEventHistoryFromFunc()` helper routine to read the correct number of IDs so it checks the correct number of events. Also correct bad event checks in TBL UT.
18+
- Adds `OS_printf` to `CFE_ES_SYSLOG_APPEND` so it matches `CFE_ES_WriteToSysLog`
19+
- Removes unused `SenderReporting` and `CFE_PLATFORM_SB_DEFAULT_REPORT_SENDER`
20+
- Tests pass when debug events are enabled via `CFE_PLATFORM_EVS_DEFAULT_TYPE_FLAG` in platform config.
21+
- Removes references to `UT_CheckForOpenSockets` which is no longer applicable since the UT framework resets the state for each unit test.
22+
- Rename `UT_ClearForceFail` as `UT_ClearDefaultValue` given change in https://github.com/nasa/osal/issues/724
23+
- Adds checks that ensure `CFE_SB_GetUserData` works with all payload data types.
24+
- Adds header padding to 64-bit so that `CFE_SB_GetUserData` will work for message structures with elements up to 64 bit
25+
- For primary-only header config: telemetry header required to 64 bit boundary (affects all receivers)
26+
- For primary and extended header config: command header required padding to 64 bit boundary (affects all senders)
27+
- Refactor `CFE_TIME_RegisterSynchCallback` to only have one return point and eliminates "possible uninitialized variable" static analysis warning
28+
- None of these changes are expected to cause problematic.
29+
- Addresses message delivery issues due to inconsistent locking by reworking cFE-SB API implementation. Ensures all events are generated and counters are incremented consistently by avoiding early returns in functions and using the `PendingEventID` register to record what event ID should be sent per the current operation.
30+
- Employs the `CFE_ES_ResourceID_t` type and related patterns for managing the SB Pipe IDs.
31+
- Will break code which directly accessed these items without going through the lookup function.
32+
- **`CFE_SB_PipeId_t` type is no longer usable as a direct array index**, increased in size from 8 to 32 bits, and is now consistent with all other ID types in both behavior and size.
33+
- **The "pipe stats" structure in the Pipe TLM is also changed**. This structure contained a `CFE_SB_PipeId_t` value, hence why it had to be updated because the type is now bigger. The spare bytes are also moved to the end of the struct.
34+
- Removes `OS_printf` checks of stub calls in unit tests and checks for specific format string in history instead to confirm the right path was taken.
35+
- Removes `CFE_MISSION_REV` from platform config.
36+
- Removes the rest of the references and uses of `CFE_PLATFORM_ES_PERF_MAX_IDS` in favor of `CFE_MISSION_ES_PERF_MAX_IDS`
37+
- Remove uses of strncpy and other minor hardcoded references
38+
- Cleanup unit tests to reflect size changes in `CFE_MISSION_MAX_API_LEN` and `CFE_MISSION_MAX_PATH_LEN`.
39+
- Moved ES pipe name and lengths to defines
40+
- Removed PipeName and PipeDepth variables from app global
41+
- Removed unnecessary (char *) casts
42+
- Simplified `&stingname[0]` to `stringname` where observed
43+
- Enables projects that have OSs with different limits to maintain a standard cmd/tlm and have unit tests pass.
44+
- Make `CFE_ES_WriteToSysLog` stub unit test more informative by adding `UtDebug` output
45+
- See <https://github.com/nasa/cFE/pull/1109>
46+
1347
### Development Build: 6.8.0-rc1+dev248
1448

1549
- Replace `OS_FileSysStatVolume()` with`OS_fsBlocksFree()` which will be deprecated. This call reports the number of total blocks, not just the free blocks, making the check more accurate and removing the need for a workaround for desktop machines.

SECURITY.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
To report a vulnerability for the cFE subsystem please [submit an issue](https://github.com/nasa/cFE/issues/new/choose).
6+
7+
For general cFS vulnerabilities please [open a cFS framework issue](https://github.com/nasa/cfs/issues/new/choose) and see our [top-level security policy](https://github.com/nasa/cFS/security/policy).
8+
9+
In either case please use the "Bug Report" template and provide as much information as possible. Apply appropraite labels for each report. For security related reports, tag the issue with the "security" label.
10+
11+
## Additional Support
12+
13+
For additional support, email us at cfs-program@lists.nasa.gov. For help using OSAL and cFS, [subscribe to our mailing list](https://lists.nasa.gov/mailman/listinfo/cfs-community) that includes all the community members/users of the NASA core Flight Software (cFS) product line. The mailing list is used to communicate any information related to the cFS product such as current releases, bug findings and fixes, enhancement requests, community meeting notifications, sending out meeting minutes, etc.
14+
15+
If you wish to report a cybersecurity incident or concern please contact the NASA Security Operations Center either by phone at 1-877-627-2732 or via email address soc@nasa.gov.
16+

cmake/sample_defs/cpu1_platform_cfg.h

-43
Original file line numberDiff line numberDiff line change
@@ -304,21 +304,6 @@
304304
#define CFE_PLATFORM_SB_MEM_BLOCK_SIZE_16 32768
305305
#define CFE_PLATFORM_SB_MAX_BLOCK_SIZE (CFE_MISSION_SB_MAX_SB_MSG_SIZE + 40)
306306

307-
/**
308-
** \cfesbcfg Define Default Sender Information Storage Mode
309-
**
310-
** \par Description:
311-
** Defines the default mode for the storing of sender information when sending
312-
** a software bus message. If set to 1, the sender information will be stored.
313-
** If set to 0, the sender information will not be stored.
314-
**
315-
** \par Limits
316-
** There is a lower limit of 0 and an upper limit of 1 on this configuration
317-
** paramater.
318-
*/
319-
#define CFE_PLATFORM_SB_DEFAULT_REPORT_SENDER 1
320-
321-
322307
/**
323308
** \cfetimecfg Time Server or Time Client Selection
324309
**
@@ -1034,19 +1019,6 @@
10341019
*/
10351020
#define CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE 1
10361021

1037-
/**
1038-
** \cfeescfg Define Max Number of Performance IDs
1039-
**
1040-
** \par Description:
1041-
** Defines the maximum number of perf ids allowed.
1042-
**
1043-
**
1044-
** \par Limits
1045-
** This number must always be divisible by 32. There is a lower limit of 32 and
1046-
** an upper limit of 512 on this configuration paramater.
1047-
*/
1048-
#define CFE_PLATFORM_ES_PERF_MAX_IDS 128
1049-
10501022
/**
10511023
** \cfeescfg Define Max Size of Performance Data Buffer
10521024
**
@@ -1814,21 +1786,6 @@
18141786
#define CFE_PLATFORM_TBL_VALID_PRID_3 0
18151787
#define CFE_PLATFORM_TBL_VALID_PRID_4 0
18161788

1817-
/** \cfeescfg Mission specific version number for cFE
1818-
**
1819-
** \par Description:
1820-
** The cFE version number consists of four parts:
1821-
** major version number, minor version number, revision
1822-
** number and mission specific revision number. The mission
1823-
** specific revision number is defined here and the other
1824-
** parts are defined in "cfe_version.h".
1825-
**
1826-
** \par Limits:
1827-
** Must be defined as a numeric value that is greater than
1828-
** or equal to zero.
1829-
*/
1830-
#define CFE_MISSION_REV 0
1831-
18321789
/** \cfeescfg Poll timer for startup sync delay
18331790
**
18341791
** \par Description:

cmake/sample_defs/sample_perfids.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
** Design Notes:
2727
** Each performance id is used to identify something that needs to be
2828
** measured. Performance ids are limited to the range of 0 to
29-
** CFE_PLATFORM_ES_PERF_MAX_IDS - 1. Any performance ids outside of this range
29+
** CFE_MISSION_ES_PERF_MAX_IDS - 1. Any performance ids outside of this range
3030
** will be ignored and will be flagged as an error. Note that
3131
** performance ids 0-31 are reserved for the cFE Core.
3232
**

cmake/sample_defs/targets.cmake

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# This file indicates the architecture and configuration of the
66
# target boards that will run core flight software.
77
#
8-
# The following variables are defined per board, where <x> is the
9-
# CPU number starting with 1:
8+
# The following variables are defined per board, where <cpuname>
9+
# is a specific name within MISSION_CPUNAMES list:
1010
#
11-
# <cpuname>_NAME : the user-friendly name of the cpu. Should be simple
12-
# word with no punctuation. This MUST be specified.
11+
# MISSION_CPUNAMES : list of user-friendly cpu names. Should be simple
12+
# words with no punctuation. This MUST be specified.
1313
# <cpuname>_APPLIST : list of applications to build and install on the CPU.
1414
# These are built as dynamically-loaded applications and installed
1515
# as files in the non-volatile storage of the target, and loaded

fsw/cfe-core/src/es/cfe_es_api.c

+16-13
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ int32 CFE_ES_GetAppName(char *AppName, CFE_ES_ResourceID_t AppId, size_t BufferL
871871
*/
872872
if (CFE_ES_AppRecordIsMatch(AppRecPtr, AppId))
873873
{
874-
strncpy(AppName, CFE_ES_AppRecordGetName(AppRecPtr), BufferLength);
874+
strncpy(AppName, CFE_ES_AppRecordGetName(AppRecPtr), BufferLength - 1);
875875
AppName[BufferLength - 1] = '\0';
876876
Result = CFE_SUCCESS;
877877
}
@@ -1306,8 +1306,8 @@ int32 CFE_ES_CreateChildTask(CFE_ES_ResourceID_t *TaskIdPtr,
13061306

13071307
CFE_ES_TaskRecordSetUsed(TaskRecPtr, ChildTaskId);
13081308
TaskRecPtr->AppId = CFE_ES_AppRecordGetID(AppRecPtr);
1309-
strncpy((char *)TaskRecPtr->TaskName,TaskName,OS_MAX_API_NAME);
1310-
TaskRecPtr->TaskName[OS_MAX_API_NAME - 1] = '\0';
1309+
strncpy(TaskRecPtr->TaskName,TaskName,sizeof(TaskRecPtr->TaskName) - 1);
1310+
TaskRecPtr->TaskName[sizeof(TaskRecPtr->TaskName) - 1] = '\0';
13111311
CFE_ES_Global.RegisteredTasks++;
13121312

13131313
*TaskIdPtr = ChildTaskId;
@@ -1737,8 +1737,8 @@ int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, size_t BlockSize, con
17371737

17381738
/* Perform a buffer overrun safe copy of name for debug log message */
17391739

1740-
strncpy(CDSName, Name, CFE_MISSION_ES_CDS_MAX_NAME_LENGTH);
1741-
CDSName[CFE_MISSION_ES_CDS_MAX_NAME_LENGTH-1] = '\0';
1740+
strncpy(CDSName, Name, sizeof(CDSName) - 1);
1741+
CDSName[sizeof(CDSName) - 1] = '\0';
17421742
CFE_ES_WriteToSysLog("CFE_CDS:Register-CDS Name (%s) is too long\n", CDSName);
17431743
}
17441744
else
@@ -1877,9 +1877,11 @@ int32 CFE_ES_RestoreFromCDS(void *RestoreToMemory, CFE_ES_CDSHandle_t Handle)
18771877
return CFE_ES_CDSBlockRead(RestoreToMemory, Handle);
18781878
} /* End of CFE_ES_RestoreFromCDS() */
18791879

1880-
/* end of file */
1881-
1882-
1880+
/*
1881+
** Function: CFE_ES_RegisterGenCounter
1882+
**
1883+
** Purpose: Allocates a generic counter resource and assigns ID
1884+
*/
18831885
int32 CFE_ES_RegisterGenCounter(CFE_ES_ResourceID_t *CounterIdPtr, const char *CounterName)
18841886
{
18851887
CFE_ES_GenCounterRecord_t *CountRecPtr;
@@ -1912,7 +1914,7 @@ int32 CFE_ES_RegisterGenCounter(CFE_ES_ResourceID_t *CounterIdPtr, const char *C
19121914
else
19131915
{
19141916
/* scan for a free slot */
1915-
PendingCounterId = CFE_ES_FindNextAvailableId(CFE_ES_Global.LastCounterId, CFE_PLATFORM_ES_MAX_GEN_COUNTERS);
1917+
PendingCounterId = CFE_ES_FindNextAvailableId(CFE_ES_Global.LastCounterId, CFE_PLATFORM_ES_MAX_GEN_COUNTERS, CFE_ES_CheckCounterIdSlotUsed);
19161918
CountRecPtr = CFE_ES_LocateCounterRecordByID(PendingCounterId);
19171919

19181920
if (CountRecPtr == NULL)
@@ -1923,7 +1925,8 @@ int32 CFE_ES_RegisterGenCounter(CFE_ES_ResourceID_t *CounterIdPtr, const char *C
19231925
else
19241926
{
19251927
strncpy(CountRecPtr->CounterName,CounterName,
1926-
sizeof(CountRecPtr->CounterName));
1928+
sizeof(CountRecPtr->CounterName) - 1);
1929+
CountRecPtr->CounterName[sizeof(CountRecPtr->CounterName) - 1] = '\0';
19271930
CountRecPtr->Counter = 0;
19281931
CFE_ES_CounterRecordSetUsed(CountRecPtr, PendingCounterId);
19291932
CFE_ES_Global.LastCounterId = PendingCounterId;
@@ -2108,7 +2111,7 @@ CFE_Status_t CFE_ES_GetGenCounterName(char *CounterName, CFE_ES_ResourceID_t Cou
21082111
*/
21092112
int32 CFE_ES_AppID_ToIndex(CFE_ES_ResourceID_t AppID, uint32 *Idx)
21102113
{
2111-
return CFE_ES_ResourceID_ToIndex_Internal(
2114+
return CFE_ES_ResourceID_ToIndex(
21122115
CFE_ES_ResourceID_ToInteger(AppID) - CFE_ES_APPID_BASE,
21132116
CFE_PLATFORM_ES_MAX_APPLICATIONS,
21142117
Idx);
@@ -2120,7 +2123,7 @@ int32 CFE_ES_AppID_ToIndex(CFE_ES_ResourceID_t AppID, uint32 *Idx)
21202123
*/
21212124
int32 CFE_ES_LibID_ToIndex(CFE_ES_ResourceID_t LibId, uint32 *Idx)
21222125
{
2123-
return CFE_ES_ResourceID_ToIndex_Internal(
2126+
return CFE_ES_ResourceID_ToIndex(
21242127
CFE_ES_ResourceID_ToInteger(LibId) - CFE_ES_LIBID_BASE,
21252128
CFE_PLATFORM_ES_MAX_LIBRARIES,
21262129
Idx);
@@ -2160,7 +2163,7 @@ int32 CFE_ES_TaskID_ToIndex(CFE_ES_ResourceID_t TaskID, uint32 *Idx)
21602163
*/
21612164
int32 CFE_ES_CounterID_ToIndex(CFE_ES_ResourceID_t CounterId, uint32 *Idx)
21622165
{
2163-
return CFE_ES_ResourceID_ToIndex_Internal(
2166+
return CFE_ES_ResourceID_ToIndex(
21642167
CFE_ES_ResourceID_ToInteger(CounterId) - CFE_ES_COUNTID_BASE,
21652168
CFE_PLATFORM_ES_MAX_GEN_COUNTERS,
21662169
Idx);

fsw/cfe-core/src/es/cfe_es_apps.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ int32 CFE_ES_AppCreate(CFE_ES_ResourceID_t *ApplicationIdPtr,
688688
else
689689
{
690690
/* scan for a free slot */
691-
PendingAppId = CFE_ES_FindNextAvailableId(CFE_ES_Global.LastAppId, CFE_PLATFORM_ES_MAX_APPLICATIONS);
691+
PendingAppId = CFE_ES_FindNextAvailableId(CFE_ES_Global.LastAppId, CFE_PLATFORM_ES_MAX_APPLICATIONS, CFE_ES_CheckAppIdSlotUsed);
692692
AppRecPtr = CFE_ES_LocateAppRecordByID(PendingAppId);
693693

694694
if (AppRecPtr == NULL)
@@ -707,12 +707,16 @@ int32 CFE_ES_AppCreate(CFE_ES_ResourceID_t *ApplicationIdPtr,
707707
AppRecPtr->Type = CFE_ES_AppType_EXTERNAL;
708708
strncpy(AppRecPtr->StartParams.BasicInfo.Name, AppName,
709709
sizeof(AppRecPtr->StartParams.BasicInfo.Name)-1);
710+
AppRecPtr->StartParams.BasicInfo.Name[sizeof(AppRecPtr->StartParams.BasicInfo.Name)-1] = '\0';
710711
strncpy(AppRecPtr->StartParams.BasicInfo.FileName, FileName,
711712
sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1);
713+
AppRecPtr->StartParams.BasicInfo.FileName[sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1] = '\0';
712714
if (EntryPointName != NULL && strcmp(EntryPointName, "NULL") != 0)
713715
{
714716
strncpy(AppRecPtr->StartParams.BasicInfo.EntryPoint, EntryPointName,
715717
sizeof(AppRecPtr->StartParams.BasicInfo.EntryPoint)-1);
718+
AppRecPtr->StartParams.BasicInfo.EntryPoint[
719+
sizeof(AppRecPtr->StartParams.BasicInfo.EntryPoint)-1] = '\0';
716720
}
717721

718722
AppRecPtr->StartParams.StackSize = StackSize;
@@ -795,6 +799,7 @@ int32 CFE_ES_AppCreate(CFE_ES_ResourceID_t *ApplicationIdPtr,
795799
return Status;
796800

797801
} /* End Function */
802+
798803
/*
799804
**---------------------------------------------------------------------------------------
800805
** Name: CFE_ES_LoadLibrary
@@ -864,7 +869,7 @@ int32 CFE_ES_LoadLibrary(CFE_ES_ResourceID_t *LibraryIdPtr,
864869
else
865870
{
866871
/* scan for a free slot */
867-
PendingLibId = CFE_ES_FindNextAvailableId(CFE_ES_Global.LastLibId, CFE_PLATFORM_ES_MAX_LIBRARIES);
872+
PendingLibId = CFE_ES_FindNextAvailableId(CFE_ES_Global.LastLibId, CFE_PLATFORM_ES_MAX_LIBRARIES, CFE_ES_CheckLibIdSlotUsed);
868873
LibSlotPtr = CFE_ES_LocateLibRecordByID(PendingLibId);
869874

870875
if (LibSlotPtr == NULL)
@@ -882,12 +887,15 @@ int32 CFE_ES_LoadLibrary(CFE_ES_ResourceID_t *LibraryIdPtr,
882887
*/
883888
strncpy(LibSlotPtr->BasicInfo.Name, LibName,
884889
sizeof(LibSlotPtr->BasicInfo.Name)-1);
890+
LibSlotPtr->BasicInfo.Name[sizeof(LibSlotPtr->BasicInfo.Name)-1] = '\0';
885891
strncpy(LibSlotPtr->BasicInfo.FileName, FileName,
886892
sizeof(LibSlotPtr->BasicInfo.FileName)-1);
893+
LibSlotPtr->BasicInfo.FileName[sizeof(LibSlotPtr->BasicInfo.FileName)-1] = '\0';
887894
if (EntryPointName != NULL && strcmp(EntryPointName, "NULL") != 0)
888895
{
889896
strncpy(LibSlotPtr->BasicInfo.EntryPoint, EntryPointName,
890897
sizeof(LibSlotPtr->BasicInfo.EntryPoint)-1);
898+
LibSlotPtr->BasicInfo.EntryPoint[sizeof(LibSlotPtr->BasicInfo.EntryPoint)-1] = '\0';
891899
}
892900

893901
CFE_ES_LibRecordSetUsed(LibSlotPtr, CFE_ES_RESOURCEID_RESERVED);

fsw/cfe-core/src/es/cfe_es_cds.c

+14-2
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,24 @@ int32 CFE_ES_CDS_EarlyInit(void)
163163
/*******************************************************************/
164164
int32 CFE_ES_CDSBlockID_ToIndex(CFE_ES_ResourceID_t BlockID, uint32 *Idx)
165165
{
166-
return CFE_ES_ResourceID_ToIndex_Internal(
166+
return CFE_ES_ResourceID_ToIndex(
167167
CFE_ES_ResourceID_ToInteger(BlockID) - CFE_ES_CDSBLOCKID_BASE,
168168
CFE_PLATFORM_ES_CDS_MAX_NUM_ENTRIES,
169169
Idx);
170170
}
171171

172+
/*---------------------------------------------------------------------------------------
173+
* Function: CFE_ES_CheckCDSBlockIdSlotUsed
174+
*
175+
* Purpose: Helper function, Aids in allocating a new ID by checking if
176+
* a given ID is available. Must be called while locked.
177+
*---------------------------------------------------------------------------------------
178+
*/
179+
bool CFE_ES_CheckCDSBlockIdSlotUsed(CFE_ES_ResourceID_t CheckId)
180+
{
181+
return CFE_ES_CDSBlockRecordIsUsed(CFE_ES_LocateCDSBlockRecordByID(CheckId));
182+
}
183+
172184
/*******************************************************************/
173185
/*
174186
* CFE_ES_LocateCDSBlockRecordByID
@@ -347,7 +359,7 @@ int32 CFE_ES_RegisterCDSEx(CFE_ES_CDSHandle_t *HandlePtr, size_t UserBlockSize,
347359
else
348360
{
349361
/* scan for a free slot */
350-
PendingBlockId = CFE_ES_FindNextAvailableId(CDS->LastCDSBlockId, CFE_PLATFORM_ES_CDS_MAX_NUM_ENTRIES);
362+
PendingBlockId = CFE_ES_FindNextAvailableId(CDS->LastCDSBlockId, CFE_PLATFORM_ES_CDS_MAX_NUM_ENTRIES, CFE_ES_CheckCDSBlockIdSlotUsed);
351363
RegRecPtr = CFE_ES_LocateCDSBlockRecordByID(PendingBlockId);
352364

353365
if (RegRecPtr != NULL)

fsw/cfe-core/src/es/cfe_es_cds.h

+14
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,20 @@ static inline size_t CFE_ES_CDSBlockRecordGetUserSize(const CFE_ES_CDS_RegRec_t
391391
return (CDSBlockRecPtr->BlockSize - sizeof(CFE_ES_CDS_BlockHeader_t));
392392
}
393393

394+
/**
395+
* @brief Check if a CDS Block ID table slot is used
396+
*
397+
* Checks if a table slot is available for a potential new ID
398+
* This is a helper function intended to be used with
399+
* CFE_ES_FindNextAvailableID() for allocating new IDs
400+
*
401+
* As this dereferences fields within the record, global data must be
402+
* locked prior to invoking this function.
403+
*
404+
* @param[in] CheckId pending/candidate Block ID to check
405+
* @returns true if the table slot for the ID is occupied, false if available
406+
*/
407+
bool CFE_ES_CheckCDSBlockIdSlotUsed(CFE_ES_ResourceID_t CheckId);
394408

395409
/*****************************************************************************/
396410
/**

fsw/cfe-core/src/es/cfe_es_erlog.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ int32 CFE_ES_WriteToERLogWithContext( CFE_ES_LogEntryType_Enum_t EntryType, ui
139139
/*
140140
** Copy the Description string to the log.
141141
*/
142-
strncpy(EntryPtr->BaseInfo.Description, Description, sizeof(EntryPtr->BaseInfo.Description));
142+
strncpy(EntryPtr->BaseInfo.Description, Description, sizeof(EntryPtr->BaseInfo.Description) - 1);
143+
EntryPtr->BaseInfo.Description[sizeof(EntryPtr->BaseInfo.Description) - 1] = '\0';
143144

144145
/*
145146
* Store the context info (if any)

fsw/cfe-core/src/es/cfe_es_log.h

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
CFE_ES_LockSharedData(__func__, __LINE__); \
106106
CFE_ES_SysLogAppend_Unsync(LogString); \
107107
CFE_ES_UnlockSharedData(__func__, __LINE__); \
108+
OS_printf("%s", LogString); \
108109
}
109110

110111

0 commit comments

Comments
 (0)