lib,rlc_am_nr: fixed stack smashing bug that happened when too many NACKs were present in the status report

master
Pedro Alvarez 3 years ago
parent ddbd857867
commit e6d976d115

@ -19,6 +19,8 @@
namespace srsran {
const uint32_t RLC_AM_NR_WINDOW_SIZE_12BIT = 4096;
const uint32_t RLC_AM_NR_WINDOW_SIZE_18BIT = 262144;
const uint32_t INVALID_RLC_SN = 0xFFFFFFFF;
///< AM NR PDU header
@ -82,7 +84,7 @@ typedef struct {
uint32_t ack_sn; ///< SN of the next not received RLC Data PDU
uint16_t N_nack; ///< number of NACKs
uint8_t nack_range; ///< number of consecutively lost RLC SDUs starting from and including NACK_SN
rlc_status_nack_t nacks[RLC_AM_WINDOW_SIZE];
rlc_status_nack_t nacks[RLC_AM_NR_WINDOW_SIZE_12BIT];
} rlc_am_nr_status_pdu_t;
/****************************************************************************

@ -1149,7 +1149,7 @@ uint32_t rlc_am_nr_rx::get_status_pdu(rlc_am_nr_status_pdu_t* status, uint32_t m
{
std::unique_lock<std::mutex> lock(mutex, std::try_to_lock);
if (not lock.owns_lock()) {
return SRSRAN_ERROR;
return 0;
}
status->N_nack = 0;

Loading…
Cancel
Save