From b6bb8cb125fb1150a64564614ff582de657e946b Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 15 Jan 2019 16:12:52 +0100 Subject: [PATCH] fix possible buffer overflow when generating PRACH sequences --- srsue/src/phy/prach.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srsue/src/phy/prach.cc b/srsue/src/phy/prach.cc index 390ff8f9d..3c230b688 100644 --- a/srsue/src/phy/prach.cc +++ b/srsue/src/phy/prach.cc @@ -175,8 +175,8 @@ int prach::tx_tti() { cf_t *prach::generate(float cfo, uint32_t *nof_sf, float *target_power) { - if (cell_initiated && preamble_idx >= 0 && nof_sf && preamble_idx <= 64 && - srslte_cell_isvalid(&cell) && len < MAX_LEN_SF * 30720 && len > 0) { + if (cell_initiated && preamble_idx >= 0 && nof_sf && preamble_idx <= 63 && srslte_cell_isvalid(&cell) && + len < MAX_LEN_SF * 30720 && len > 0) { // Correct CFO before transmission FIXME: UL SISO Only srslte_cfo_correct(&cfo_h, buffer[preamble_idx], signal_buffer, cfo / srslte_symbol_sz(cell.nof_prb));