From a0665b721e9dbad1d45fd833779fed8feb116fa8 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 6 May 2020 22:22:21 +0200 Subject: [PATCH] prach: fix illegal mem access when wrong configs are passed this fixes Coverity issue 1480095 --- lib/src/phy/phch/prach.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/phy/phch/prach.c b/lib/src/phy/phch/prach.c index ecdbe93cb..bdd1edde2 100644 --- a/lib/src/phy/phch/prach.c +++ b/lib/src/phy/phch/prach.c @@ -171,8 +171,8 @@ bool srslte_prach_tti_opportunity_config_tdd(uint32_t config_idx, uint32_t current_tti, uint32_t* prach_idx) { - if (config_idx >= 64 && tdd_ul_dl_config >= 7) { - ERROR("PRACH: Invalid parmeters config_idx=%d, tdd_ul_config=%d\n", config_idx, tdd_ul_dl_config); + if (config_idx >= 64 || tdd_ul_dl_config >= 7) { + ERROR("PRACH: Invalid parameters config_idx=%d, tdd_ul_config=%d\n", config_idx, tdd_ul_dl_config); return 0; }