From 5cd7ffcbb29caf566a64cf4c1219bc17b4591bf3 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 27 Oct 2020 11:40:53 -0400 Subject: [PATCH] Fix #966, update padding in CDS registry record As the name field is a multiple of 4 bytes, there needs to be 3 bytes of padding, not 1, to avoid implicit padding. This doesn't change anything, it just makes the padding explicit instead of implicit. --- fsw/cfe-core/src/es/cfe_es_task.c | 2 +- fsw/cfe-core/src/inc/cfe_es_msg.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsw/cfe-core/src/es/cfe_es_task.c b/fsw/cfe-core/src/es/cfe_es_task.c index 65bc828b6..0d4e8a202 100644 --- a/fsw/cfe-core/src/es/cfe_es_task.c +++ b/fsw/cfe-core/src/es/cfe_es_task.c @@ -1830,7 +1830,7 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistry_t *data) DumpRecord.Size = CFE_ES_CDSBlockRecordGetUserSize(RegRecPtr); DumpRecord.Handle = CFE_ES_CDSBlockRecordGetID(RegRecPtr); DumpRecord.Table = RegRecPtr->Table; - DumpRecord.ByteAlignSpare1 = 0; + memset(DumpRecord.ByteAlignSpare, 0, sizeof(DumpRecord.ByteAlignSpare)); /* strncpy will zero out any unused buffer - memset not necessary */ strncpy(DumpRecord.Name, RegRecPtr->Name, sizeof(DumpRecord.Name)-1); diff --git a/fsw/cfe-core/src/inc/cfe_es_msg.h b/fsw/cfe-core/src/inc/cfe_es_msg.h index cb17775b7..602bc058f 100644 --- a/fsw/cfe-core/src/inc/cfe_es_msg.h +++ b/fsw/cfe-core/src/inc/cfe_es_msg.h @@ -1478,7 +1478,7 @@ typedef struct CFE_ES_CDSRegDumpRec CFE_ES_CDS_Offset_t Size; /**< \brief Size, in bytes, of the CDS memory block */ bool Table; /**< \brief Flag that indicates whether CDS contains a Critical Table */ char Name[CFE_MISSION_ES_CDS_MAX_NAME_LEN]; /**< \brief Processor Unique Name of CDS */ - uint8 ByteAlignSpare1; /**< \brief Spare byte to insure structure size is multiple of 4 bytes */ + uint8 ByteAlignSpare[3]; /**< \brief Spare bytes to ensure structure size is multiple of 4 bytes */ } CFE_ES_CDSRegDumpRec_t; /**