HO Preparation: calloc pdcp_config in DRB to Modify Item decoding

The malloced struct is initialized to garbage and when
the IE is absent, the output "PDCP reestablishment"
member (allocated in the stack) is set to a random value.
This commit is contained in:
Guido Casati
2025-09-15 10:03:11 +02:00
parent 206c7667e6
commit 9f97320cbe
@@ -1658,7 +1658,7 @@ static bool e1_decode_pdu_session_to_mod_item(pdu_session_to_mod_t *out, const E
drb->id = drb2Mod->dRB_ID;
// PDCP Config (O)
if (drb2Mod->pDCP_Configuration) {
drb->pdcp_config = malloc_or_fail(sizeof(*drb->pdcp_config));
drb->pdcp_config = calloc_or_fail(1, sizeof(*drb->pdcp_config));
CHECK_E1AP_DEC(e1_decode_pdcp_config(drb->pdcp_config, drb2Mod->pDCP_Configuration));
}
// SDAP Config (O)