mirror of https://github.com/PentHertz/srsLTE.git
rlc: add length check for RLC PDU generation
makes sure that RLC doesn't generate a PDU larger than the provided grant size
This commit is contained in:
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…
Reference in New Issue