Add asserts for size of rx_indication_body.rx_pdu_list

This commit is contained in:
Michael Cook
2021-03-13 10:26:33 -08:00
parent b726053982
commit df81c0de14
7 changed files with 36 additions and 10 deletions
+2
View File
@@ -227,6 +227,7 @@ void handle_ulsch(UL_IND_t *UL_info) {
} else if(NFAPI_MODE == NFAPI_MODE_VNF) {
for(uint8_t k = 0; k < NUM_NFPAI_SUBFRAME; k++) {
if((UL_RCC_INFO.rx_ind[k].rx_indication_body.number_of_pdus>0) && (UL_RCC_INFO.crc_ind[k].crc_indication_body.number_of_crcs>0)) {
assert(UL_RCC_INFO.rx_ind[k].rx_indication_body.number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
for (i=0; i<UL_RCC_INFO.rx_ind[k].rx_indication_body.number_of_pdus; i++) {
for (j=0; j<UL_RCC_INFO.crc_ind[k].crc_indication_body.number_of_crcs; j++) {
// find crc_indication j corresponding rx_indication i
@@ -280,6 +281,7 @@ void handle_ulsch(UL_IND_t *UL_info) {
}
} else {
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
assert(UL_info->rx_ind.rx_indication_body.number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
for (i=0; i<UL_info->rx_ind.rx_indication_body.number_of_pdus; i++) {
for (j=0; j<UL_info->crc_ind.crc_indication_body.number_of_crcs; j++) {
// find crc_indication j corresponding rx_indication i
+2
View File
@@ -87,6 +87,7 @@ void fill_rx_indication_UE_MAC(module_id_t Mod_id,
UL_INFO->rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
UL_INFO->rx_ind.vendor_extension = ul_config_req->vendor_extension;
assert(UL_INFO->rx_ind.rx_indication_body.number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
pdu = &UL_INFO->rx_ind.rx_indication_body
.rx_pdu_list[UL_INFO->rx_ind.rx_indication_body.number_of_pdus];
// pdu = &UL_INFO->rx_ind.rx_indication_body.rx_pdu_list[index];
@@ -1538,6 +1539,7 @@ static void print_rx_ind(nfapi_rx_indication_t *p)
printf("rx_indication_body.tl.length: %u\n", p->rx_indication_body.tl.length);
printf("rx_indication_body.number_of_pdus: %u\n", p->rx_indication_body.number_of_pdus);
assert(p->rx_indication_body.number_of_pdus <= NFAPI_RX_IND_MAX_PDU);
nfapi_rx_indication_pdu_t *pdu = p->rx_indication_body.rx_pdu_list;
for (int i = 0; i < p->rx_indication_body.number_of_pdus; i++)
{