From 7fcf9ac24ad1148194f7621ad88f46b056268d6c Mon Sep 17 00:00:00 2001 From: ArielSAdamsNASA Date: Tue, 12 Oct 2021 09:42:34 -0500 Subject: [PATCH 1/2] Fix #89, Check get_sh_entsize(SectionHeader) value --- elf2cfetbl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/elf2cfetbl.c b/elf2cfetbl.c index 182f7c4..255a162 100644 --- a/elf2cfetbl.c +++ b/elf2cfetbl.c @@ -1774,7 +1774,14 @@ int32 GetSectionHeader(int32 SectionIndex, union Elf_Shdr *SectionHeader) SymbolTableDataOffset = SectionHeader->Shdr64.sh_offset + sizeof(Elf64_Sym); } SymbolTableEntrySize = get_sh_entsize(SectionHeader); - NumSymbols = (get_sh_size(SectionHeader) / get_sh_entsize(SectionHeader)) - 1; + if (SymbolTableEntrySize == 0) + { + NumSymbols = 0; + } + else + { + NumSymbols = (get_sh_size(SectionHeader) / SymbolTableEntrySize) - 1; + } sprintf(VerboseStr, "SHT_SYMTAB (2) - # Symbols = %lu", (long unsigned int)NumSymbols); break; From 8afde1d2ed6a3de115be4901eaa197a0fa6b7f36 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Wed, 1 Dec 2021 17:43:06 -0500 Subject: [PATCH 2/2] Update build baseline and bump to v3.3.0-rc4+dev4 - Set baseline for cFS-Caelum-rc4: v3.3.0-rc4 - Update mission rev to use 0xFF for development version --- README.md | 7 +++++++ elf2cfetbl_version.h | 21 ++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7472ae6..085bb9e 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,13 @@ See README.txt for more information. ## Version History +### Development Build: v3.3.0-rc4+dev4 + +- Fix Untrusted divisor (TAINTED_SCALAR) static analysis warning by checking `get_sh_entsize(SectionHeader)` +- Set baseline for cFS-Caelum-rc4: v3.3.0-rc4 +- Update mission rev to use 0xFF for development version +- See and + ### Development Build: v3.2.0-rc1+dev30 - Implement Coding Standard in CodeQL workflow diff --git a/elf2cfetbl_version.h b/elf2cfetbl_version.h index 16b3837..4f08bf1 100644 --- a/elf2cfetbl_version.h +++ b/elf2cfetbl_version.h @@ -30,9 +30,9 @@ /* * Development Build Macro Definitions */ -#define ELF2CFETBL_BUILD_NUMBER 30 /*!< @brief Number of commits since baseline */ +#define ELF2CFETBL_BUILD_NUMBER 4 /*!< @brief Number of commits since baseline */ #define ELF2CFETBL_BUILD_BASELINE \ - "v3.2.0-rc1" /*!< @brief Development Build: git tag that is the base for the current */ + "v3.3.0-rc4" /*!< @brief Development Build: git tag that is the base for the current */ /* * Version Macro Definitions @@ -40,7 +40,14 @@ #define ELF2CFETBL_MAJOR_VERSION 3 /*!< @brief ONLY APPLY for OFFICIAL releases. Major version number. */ #define ELF2CFETBL_MINOR_VERSION 1 /*!< @brief ONLY APPLY for OFFICIAL releases. Minor version number. */ #define ELF2CFETBL_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision version number. */ -#define ELF2CFETBL_MISSION_REV 0 /*!< @brief ONLY USED by MISSION Implementations. Mission revision */ + +/*! + * @brief Mission revision. + * + * Set to 0 on OFFICIAL releases, and set to 255 (0xFF) on development versions. + * Values 1-254 are reserved for mission use to denote patches/customizations as needed. + */ +#define ELF2CFETBL_MISSION_REV 0xFF /* * Tools to construct version string @@ -59,9 +66,9 @@ * @details Reports the current development build's baseline, number, and name. Also includes a note about the latest * official version. @n See @ref cfsversions for format differences between development and release versions. */ -#define ELF2CFETBL_VERSION_STRING \ - " elf2cfetbl Development Build\n" \ - " " ELF2CFETBL_VERSION " (Codename: Bootes)\n" /* Codename for current development */ \ - " Last Official Release: elf2cfetbl v3.1.0" /* For full support please use official release version */ +#define ELF2CFETBL_VERSION_STRING \ + " elf2cfetbl Development Build\n" \ + " " ELF2CFETBL_VERSION " (Codename: Draco)\n" /* Codename for current development */ \ + " Last Official Release: elf2cfetbl v3.1.0" /* For full support please use official release version */ #endif /* ELF2CFETBL_VERSION_H */