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: Unintentional integer overflow

overflow_before_widen: Potentially overflowing expression this->d_fft_size * ninput_items[0UL] with type unsigned int (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type uint64_t (64 bits, unsigned)
This commit is contained in:
Carles Fernandez 2022-02-16 15:02:27 +01:00
parent 3755d78aee
commit dae76fa70e
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -256,7 +256,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
d_state = 1; d_state = 1;
} }
d_sample_counter += static_cast<uint64_t>(d_sampled_ms * d_samples_per_ms * ninput_items[0]); // sample counter d_sample_counter += static_cast<uint64_t>(d_sampled_ms) * d_samples_per_ms * ninput_items[0]; // sample counter
consume_each(ninput_items[0]); consume_each(ninput_items[0]);
// DLOG(INFO) << "END CASE 0"; // DLOG(INFO) << "END CASE 0";
break; break;
@ -495,7 +495,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
d_active = false; d_active = false;
d_state = 0; d_state = 0;
d_sample_counter += static_cast<uint64_t>(d_sampled_ms * d_samples_per_ms * ninput_items[0]); // sample counter d_sample_counter += static_cast<uint64_t>(d_sampled_ms) * d_samples_per_ms * ninput_items[0]; // sample counter
consume_each(ninput_items[0]); consume_each(ninput_items[0]);
acquisition_message = 1; acquisition_message = 1;
@ -538,7 +538,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
d_active = false; d_active = false;
d_state = 0; d_state = 0;
d_sample_counter += static_cast<uint64_t>(d_sampled_ms * d_samples_per_ms * ninput_items[0]); // sample counter d_sample_counter += static_cast<uint64_t>(d_sampled_ms) * d_samples_per_ms * ninput_items[0]; // sample counter
consume_each(ninput_items[0]); consume_each(ninput_items[0]);
acquisition_message = 2; acquisition_message = 2;