From 5a5e7941c861521e9ee62cf98bd8c802288b3d16 Mon Sep 17 00:00:00 2001 From: jdfiguer Date: Mon, 10 Jun 2024 14:55:44 -0400 Subject: [PATCH] Fix #71, Adds JSC 2.1 Static Analysis comments --- fsw/src/md_dwell_tbl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fsw/src/md_dwell_tbl.c b/fsw/src/md_dwell_tbl.c index c511bdb..37a86a9 100644 --- a/fsw/src/md_dwell_tbl.c +++ b/fsw/src/md_dwell_tbl.c @@ -392,6 +392,7 @@ CFE_Status_t MD_UpdateTableDwellEntry(uint16 TableIndex, uint16 EntryIndex, uint strncpy(EntryPtr->DwellAddress.SymName, NewDwellAddress.SymName, OS_MAX_SYM_LEN - 1); /* Ensure string is null terminated. */ + /* SAD: SymName’s last element is accessed on this line by reference to its max size, greatly reducing an off by one risk */ EntryPtr->DwellAddress.SymName[OS_MAX_SYM_LEN - 1] = '\0'; /* Notify Table Services that buffer was modified */