Commit cbe8b934 authored by Ding Yumei's avatar Ding Yumei

fix segmentation fault(mac head error)

parent 51b12592
...@@ -1146,6 +1146,10 @@ parse_ulsch_header(unsigned char *mac_header, ...@@ -1146,6 +1146,10 @@ parse_ulsch_header(unsigned char *mac_header,
tb_length, tb_length,
length, length,
mac_header_ptr - mac_header); mac_header_ptr - mac_header);
if(num_sdus >= NB_RB_MAX){
LOG_E(MAC,"parse_ulsch_header: num_sdus(%d) reach max\n",num_sdus);
return NULL;
}
rx_lcids[num_sdus] = lcid; rx_lcids[num_sdus] = lcid;
rx_lengths[num_sdus] = length; rx_lengths[num_sdus] = length;
num_sdus++; num_sdus++;
...@@ -1153,6 +1157,10 @@ parse_ulsch_header(unsigned char *mac_header, ...@@ -1153,6 +1157,10 @@ parse_ulsch_header(unsigned char *mac_header,
if (lcid == SHORT_PADDING) { if (lcid == SHORT_PADDING) {
mac_header_ptr++; mac_header_ptr++;
} else { } else {
if(num_ces >= MAX_NUM_CE){
LOG_E(MAC,"parse_ulsch_header: num_ces(%d) reach max\n",num_ces);
return NULL;
}
rx_ces[num_ces] = lcid; rx_ces[num_ces] = lcid;
num_ces++; num_ces++;
mac_header_ptr++; mac_header_ptr++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment