From 39e97cbcf45e0b2fee26af770b764c19eaf92d0a Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Fri, 26 Mar 2021 09:54:16 +0100 Subject: [PATCH] Fix unbounded memory access --- lib/src/phy/phch/sch_nr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/phy/phch/sch_nr.c b/lib/src/phy/phch/sch_nr.c index a28a40253..759c277de 100644 --- a/lib/src/phy/phch/sch_nr.c +++ b/lib/src/phy/phch/sch_nr.c @@ -648,7 +648,7 @@ int sch_nr_decode(srsran_sch_nr_t* q, // Check if TB is all zeros bool all_zeros = true; - for (uint32_t i = 0; i < tb->tbs && all_zeros; i++) { + for (uint32_t i = 0; i < tb->tbs / 8 && all_zeros; i++) { all_zeros = (data[i] == 0); }