bug fixes from Fujitsu (bugs 18, 19, 20)

----------------------------------------------------------
bug 18

Ttile:
Probably he/she wants to copy the contents of arrays, but
this coding doesn't copy anything, moreover index overflow
occurs.

Bug Location:
u2e_t[UE_id][eNB_id]->tx_data[3]=tx[eNB_id][3];
u2e_t[UE_id][eNB_id]->rx_data[3]=rx[NB_eNB_INST+UE_id][3];

Note:
Detected by CppCheck
----------------------------------------------------------
bug 19

Title:
Probably he/she wants to copy the contents of arrays, but
this coding doesn't copy anything, moreover index overflow
occurs.

Bug Location:
e2u_t[eNB_id][UE_id]->tx_data[3]=tx[NB_eNB_INST+UE_id][3];
e2u_t[eNB_id][UE_id]->rx_data[3]=rx[eNB_id][3];

Note:
Detected by CppCheck
----------------------------------------------------------
bug 20

Title:
Probably he/she wants to copy the contents of arrays, but
this coding doesn't copy anything, moreover index overflow
occurs.

Bug Location:
tx_data[3]=cthread->tx_data[3];
rx_data[3]=cthread->rx_data[3];

Note:
Detected by CppCheck
----------------------------------------------------------
This commit is contained in:
gabrielC
2017-05-12 11:06:10 +02:00
committed by Cedric Roux
parent c124e32ab5
commit bdaef7956d
2 changed files with 18 additions and 6 deletions
+11 -4
View File
@@ -284,8 +284,12 @@ void Channel_Inst(int node_id,int port,double **s_re[MAX_eNB+MAX_UE],double **s_
u2e_t[UE_id][eNB_id]->next_slot=&next_slot;
u2e_t[UE_id][eNB_id]->abstraction_flag=&abstraction_flag;
u2e_t[UE_id][eNB_id]->frame_parms=frame_parms;
u2e_t[UE_id][eNB_id]->tx_data[3]=tx[eNB_id][3];
u2e_t[UE_id][eNB_id]->rx_data[3]=rx[NB_eNB_INST+UE_id][3];
for (int i=0;i<3;i++)
{
u2e_t[UE_id][eNB_id]->tx_data[i]=tx[eNB_id][i];
u2e_t[UE_id][eNB_id]->rx_data[i]=rx[NB_eNB_INST+UE_id][i];
}
if(pthread_cond_init (&downlink_cond[eNB_id][UE_id], NULL)) exit(1);
@@ -316,8 +320,11 @@ void Channel_Inst(int node_id,int port,double **s_re[MAX_eNB+MAX_UE],double **s_
e2u_t[eNB_id][UE_id]->next_slot=&next_slot;
e2u_t[eNB_id][UE_id]->abstraction_flag=&abstraction_flag;
e2u_t[eNB_id][UE_id]->frame_parms=frame_parms;
e2u_t[eNB_id][UE_id]->tx_data[3]=tx[NB_eNB_INST+UE_id][3];
e2u_t[eNB_id][UE_id]->rx_data[3]=rx[eNB_id][3];
for (int i=0;i<3;i++)
{
e2u_t[eNB_id][UE_id]->tx_data[i]=tx[NB_eNB_INST+UE_id][i];
e2u_t[eNB_id][UE_id]->rx_data[i]=rx[eNB_id][i];
}
if(pthread_cond_init (&uplink_cond[UE_id][eNB_id], NULL)) exit(1);