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 13, 2024
1 parent 505baa1 commit 790c54f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 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,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] 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
1 change: 1 addition & 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,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] 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 790c54f

Please sign in to comment.