From 213769fa3d2819d5a4eaf603c892391ebc9cf639 Mon Sep 17 00:00:00 2001 From: joaquim-SRS Date: Tue, 14 Dec 2021 11:51:00 +0100 Subject: [PATCH] Fix stringop overflow error --- lib/src/phy/ue/test/gen_ack_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/phy/ue/test/gen_ack_test.c b/lib/src/phy/ue/test/gen_ack_test.c index a520fb4df..a37811b1e 100644 --- a/lib/src/phy/ue/test/gen_ack_test.c +++ b/lib/src/phy/ue/test/gen_ack_test.c @@ -38,7 +38,7 @@ int fdd_tests(uint32_t max_cc) ue_dl.cell.frame_type = SRSRAN_FDD; for (uint32_t nof_cc = 1; nof_cc <= max_cc; nof_cc++) { - for (uint32_t nof_tb = 1; nof_tb <= SRSRAN_MAX_CODEWORDS; nof_tb++) { + for (uint8_t nof_tb = 1; nof_tb <= SRSRAN_MAX_CODEWORDS; nof_tb++) { for (uint32_t nof_active_cc = 1; nof_active_cc <= nof_cc; nof_active_cc++) { for (uint32_t nof_active_tb = 1; nof_active_tb <= nof_tb; nof_active_tb++) { srsran_pdsch_ack_t ack_info = {}; @@ -53,7 +53,7 @@ int fdd_tests(uint32_t max_cc) ack_info.cc[cc_idx].m[0].present = cc_idx < nof_active_cc; ack_info.cc[cc_idx].m[0].resource.n_cce = cc_idx + 1; if (ack_info.cc[cc_idx].m[0].present) { - for (uint32_t j = 0; j < nof_tb; j++) { + for (uint8_t j = 0; j < nof_tb; j++) { ack_info.cc[cc_idx].m[0].value[j] = j < nof_active_tb ? 1 : 2; } } else {