From b17354b74f9683256f8aaf22449e6fdd668d9306 Mon Sep 17 00:00:00 2001 From: Jaroslava Fiedlerova Date: Wed, 12 Jun 2024 10:29:50 +0200 Subject: [PATCH] Fix integer overflow Avoid UBSan error: openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c:246:18: runtime error: signed integer overflow: 1457321472 + 922889664 cannot be represented in type 'int' --- openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c index 061cb93d04..c8cc7f98d9 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c +++ b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c @@ -203,7 +203,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, unsigned char symbol, uint8_t nrOfLayers) { - int rx_power_tot = 0; + uint32_t rx_power_tot = 0; unsigned short rx_power_avg_dB; unsigned short rx_power_tot_dB; RU_t *ru = gNB->RU_list[0];