From 3e6931200e82a9ca46a16aa8f9d67f9d7bfdb0b1 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 20 Jul 2020 10:03:53 +0200 Subject: [PATCH] Fix bug in Galileo E5b generation (out of bounds read) --- .../signal_generator/gnuradio_blocks/signal_generator_c.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc index 218ce87ab..b67404563 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc @@ -429,7 +429,7 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)), // New random data bit current_data_bit_int_[sat] = (uniform_dist(e1) % 2) == 0 ? 1 : -1; } - data_modulation_[sat] = current_data_bit_int_[sat] * (GALILEO_E5B_I_SECONDARY_CODE[((ms_counter_[sat] + delay_sec_[sat]) % 20)] == '0' ? 1 : -1); + data_modulation_[sat] = current_data_bit_int_[sat] * (GALILEO_E5B_I_SECONDARY_CODE[((ms_counter_[sat] + delay_sec_[sat]) % 4)] == '0' ? 1 : -1); pilot_modulation_[sat] = (GALILEO_E5B_Q_SECONDARY_CODE[PRN_[sat] - 1][((ms_counter_[sat] + delay_sec_[sat]) % 100)] == '0' ? 1 : -1); ms_counter_[sat] = ms_counter_[sat] + static_cast(round(1e3 * GALILEO_E5B_CODE_PERIOD_S));