mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +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:
		| @@ -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; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez