From 823dde8ea7b4f22c697922e5c078ce9f312c6663 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Mon, 13 Jun 2016 16:47:15 +0200 Subject: [PATCH] prach: added check for freq_offset space --- srslte/lib/phch/prach.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/srslte/lib/phch/prach.c b/srslte/lib/phch/prach.c index 721e568fa..128de1860 100644 --- a/srslte/lib/phch/prach.c +++ b/srslte/lib/phch/prach.c @@ -466,6 +466,11 @@ int srslte_prach_gen(srslte_prach_t *p, uint32_t K = DELTA_F/DELTA_F_RA; uint32_t begin = PHI + (K*k_0) + (K/2); + if (6 + freq_offset > N_rb_ul) { + fprintf(stderr, "Error no space for PRACH: frequency offset=%d, N_rb_ul=%d\n", freq_offset, N_rb_ul); + return ret; + } + DEBUG("N_zc: %d, N_cp: %d, N_seq: %d, N_ifft_prach=%d begin: %d\n", p->N_zc, p->N_cp, p->N_seq, p->N_ifft_prach, begin);