diff --git a/fsw/src/cf_utils.c b/fsw/src/cf_utils.c index 4b35c9b6..fd0de9fb 100644 --- a/fsw/src/cf_utils.c +++ b/fsw/src/cf_utils.c @@ -184,19 +184,23 @@ CFE_Status_t CF_WriteHistoryEntryToFile(osal_id_t fd, const CF_History_t *histor { case 0: CF_Assert(history->dir < CF_Direction_NUM); + /* SAD: Using snprintf since the buffer size is guaranteed to be sufficient for snprintf output */ snprintf(linebuf, sizeof(linebuf), "SEQ (%lu, %lu)\tDIR: %s\tPEER %lu\tSTAT: %d\t", (unsigned long)history->src_eid, (unsigned long)history->seq_num, CF_DSTR[history->dir], (unsigned long)history->peer_eid, (int)history->txn_stat); break; case 1: + /* SAD: Using snprintf since the buffer size is guaranteed to be sufficient for snprintf output */ snprintf(linebuf, sizeof(linebuf), "SRC: %s\t", history->fnames.src_filename); break; case 2: default: + /* SAD: Using snprintf since the buffer size is guaranteed to be sufficient for snprintf output */ snprintf(linebuf, sizeof(linebuf), "DST: %s\n", history->fnames.dst_filename); break; } + /* SAD: Using strlen since linebuf is guaranteed to be null-terminated by snprintf */ len = strlen(linebuf); ret = CF_WrappedWrite(fd, linebuf, len); if (ret != len)