Skip to content

Commit

Permalink
Fix #2552, Adds JSC 2.1 Static Analysis comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jdfiguer authored and jdfiguer committed Jun 14, 2024
1 parent 505baa1 commit 0b8ed65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/fs/fsw/src/cfe_fs_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ 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] since both pointers are used to manipulate bytes within 4-byte
* integers */
OutPtr[0] = InPtr[3];
OutPtr[1] = InPtr[2];
OutPtr[2] = InPtr[1];
Expand Down
2 changes: 2 additions & 0 deletions modules/tbl/fsw/src/cfe_tbl_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,8 @@ 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] since both pointers are used to manipulate bytes within 4-byte
* integers */
OutPtr[0] = InPtr[3];
OutPtr[1] = InPtr[2];
OutPtr[2] = InPtr[1];
Expand Down

0 comments on commit 0b8ed65

Please sign in to comment.