From e5fbf9efdd1d70d5b49d7e296142748a44ad9d61 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 25 Jul 2023 14:27:57 -0400 Subject: [PATCH] Fix #401, use valid size when calling CFE_MSG_Init Use the offset of the payload start, which by definition must include at least enough space for the primary header. This ensures that the value will pass any size check enforced in CFE_MSG_Init. --- fsw/src/cf_cfdp_sbintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsw/src/cf_cfdp_sbintf.c b/fsw/src/cf_cfdp_sbintf.c index 12495c71..eb07391d 100644 --- a/fsw/src/cf_cfdp_sbintf.c +++ b/fsw/src/cf_cfdp_sbintf.c @@ -118,7 +118,7 @@ CF_Logical_PduBuffer_t *CF_CFDP_MsgOutGet(const CF_Transaction_t *t, bool silent if (success) { CFE_MSG_Init(&CF_AppData.engine.out.msg->Msg, - CFE_SB_ValueToMsgId(CF_AppData.config_table->chan[t->chan_num].mid_output), 0); + CFE_SB_ValueToMsgId(CF_AppData.config_table->chan[t->chan_num].mid_output), offsetof(CF_PduTlmMsg_t, ph)); ++CF_AppData.engine.outgoing_counter; /* even if max_outgoing_messages_per_wakeup is 0 (unlimited), it's ok to inc this */