rlc: add length check for RLC PDU generation

makes sure that RLC doesn't generate a PDU larger than
the provided grant size
master
Andre Puschmann 4 years ago
parent c1b66e89a5
commit b991b07167

@ -294,6 +294,8 @@ int rlc::read_pdu(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes)
logger.warning("LCID %d doesn't exist.", lcid);
}
srsran_expect(ret <= nof_bytes, "Created too big RLC PDU (%d > %d)", ret, nof_bytes);
return ret;
}
@ -309,6 +311,8 @@ int rlc::read_pdu_mch(uint32_t lcid, uint8_t* payload, uint32_t nof_bytes)
logger.warning("LCID %d doesn't exist.", lcid);
}
srsran_expect(ret <= nof_bytes, "Created too big RLC PDU for MCH (%d > %d)", ret, nof_bytes);
return ret;
}

Loading…
Cancel
Save