1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Fix defects detected by Coverity Scan 2021.12.1: Out-of-bounds access (ARRAY_VS_SINGLETON)

callee_ptr_arith: Passing &this->d_acquisition_gnss_synchro->System to function basic_string which uses it as an array. This might corrupt or misinterpret adjacent memory locations
This commit is contained in:
Carles Fernandez 2022-02-16 13:56:25 +01:00
parent c151b03b77
commit 3755d78aee
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
10 changed files with 11 additions and 11 deletions

View File

@ -178,7 +178,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::start_tracking()
d_carrier_doppler_hz = d_acq_carrier_doppler_hz;
d_current_prn_length_samples = d_vector_length;
sys = std::string(&d_acquisition_gnss_synchro->System, 0, 1);
sys = std::string(1, d_acquisition_gnss_synchro->System);
// DEBUG OUTPUT
std::cout << "Tracking of Galileo E1 signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n';

View File

@ -263,7 +263,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
d_pll_to_dll_assist_secs_Ti = 0.0;
d_code_phase_samples = d_acq_code_phase_samples;
sys = std::string(&d_acquisition_gnss_synchro->System, 0, 1);
sys = std::string(1, d_acquisition_gnss_synchro->System);
d_acc_carrier_phase_initialized = false;
// DEBUG OUTPUT

View File

@ -263,7 +263,7 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking()
d_pll_to_dll_assist_secs_Ti = 0.0;
d_code_phase_samples = d_acq_code_phase_samples;
sys = std::string(&d_acquisition_gnss_synchro->System, 0, 1);
sys = std::string(1, d_acquisition_gnss_synchro->System);
d_acc_carrier_phase_initialized = false;
// DEBUG OUTPUT

View File

@ -205,7 +205,7 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
d_code_phase_samples = d_acq_code_phase_samples;
sys = std::string(&d_acquisition_gnss_synchro->System, 0, 1);
sys = std::string(1, d_acquisition_gnss_synchro->System);
d_acc_carrier_phase_initialized = false;
// DEBUG OUTPUT

View File

@ -259,7 +259,7 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::start_tracking()
d_pll_to_dll_assist_secs_Ti = 0.0;
d_code_phase_samples = d_acq_code_phase_samples;
sys = std::string(&d_acquisition_gnss_synchro->System, 0, 1);
sys = std::string(1, d_acquisition_gnss_synchro->System);
// DEBUG OUTPUT
std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n';

View File

@ -260,7 +260,7 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_sc::start_tracking()
d_pll_to_dll_assist_secs_Ti = 0.0;
d_code_phase_samples = d_acq_code_phase_samples;
sys = std::string(&d_acquisition_gnss_synchro->System, 0, 1);
sys = std::string(1, d_acquisition_gnss_synchro->System);
// DEBUG OUTPUT
std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n';

View File

@ -206,7 +206,7 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::start_tracking()
d_code_phase_samples = d_acq_code_phase_samples;
sys = std::string(&d_acquisition_gnss_synchro->System, 0, 1);
sys = std::string(1, d_acquisition_gnss_synchro->System);
// DEBUG OUTPUT
std::cout << "Tracking of GLONASS L2 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n';

View File

@ -218,7 +218,7 @@ void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::start_tracking()
d_pll_to_dll_assist_secs_Ti = 0.0;
d_code_phase_samples = d_acq_code_phase_samples;
sys = std::string(&d_acquisition_gnss_synchro->System, 0, 1);
sys = std::string(1, d_acquisition_gnss_synchro->System);
// DEBUG OUTPUT
std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n';

View File

@ -302,8 +302,8 @@ void Gps_L1_Ca_Kf_Tracking_cc::start_tracking()
d_code_phase_samples = d_acq_code_phase_samples;
sys = std::string(&d_acquisition_gnss_synchro->System, 0, 1);
sys = std::string(1, d_acquisition_gnss_synchro->System);
std::cout << "++++++++++++++ " << sys << "++++++++++++\n";
// DEBUG OUTPUT
std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n';
LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;

View File

@ -203,7 +203,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
d_code_phase_samples = d_acq_code_phase_samples;
sys = std::string(&d_acquisition_gnss_synchro->System, 0, 1);
sys = std::string(1, d_acquisition_gnss_synchro->System);
// DEBUG OUTPUT
std::cout << "Tracking of GPS L1 C/A signal started on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << '\n';