From 4faf0d36f166aed71fb45a230ff0bbe3b30d99bc Mon Sep 17 00:00:00 2001 From: jdfiguer Date: Thu, 13 Jun 2024 13:24:50 -0400 Subject: [PATCH] Fix #2552, Adds JSC 2.1 Static Analysis comments --- modules/fs/fsw/src/cfe_fs_api.c | 1 + modules/tbl/fsw/src/cfe_tbl_internal.c | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/fs/fsw/src/cfe_fs_api.c b/modules/fs/fsw/src/cfe_fs_api.c index fbd0e54a0..40812f7b2 100644 --- a/modules/fs/fsw/src/cfe_fs_api.c +++ b/modules/fs/fsw/src/cfe_fs_api.c @@ -354,6 +354,7 @@ void CFE_FS_ByteSwapUint32(uint32 *Uint32ToSwapPtr) char *InPtr = (char *)&Temp; char *OutPtr = (char *)Uint32ToSwapPtr; + /* SAD: Safe access to InPtr[0-3] and OutPtr[0-3] as both manipulate bytes within 4-byte integers. */ OutPtr[0] = InPtr[3]; OutPtr[1] = InPtr[2]; OutPtr[2] = InPtr[1]; diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.c b/modules/tbl/fsw/src/cfe_tbl_internal.c index 4ab8ef482..bf7949865 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.c +++ b/modules/tbl/fsw/src/cfe_tbl_internal.c @@ -904,6 +904,7 @@ void CFE_TBL_ByteSwapUint32(uint32 *Uint32ToSwapPtr) char *InPtr = (char *)&Temp; char *OutPtr = (char *)Uint32ToSwapPtr; + /* SAD: Safe access to InPtr[0-3] and OutPtr[0-3] as both manipulate bytes within 4-byte integers. */ OutPtr[0] = InPtr[3]; OutPtr[1] = InPtr[2]; OutPtr[2] = InPtr[1];