From 516b91fc908d37911f4a50650a5f7666de67024d Mon Sep 17 00:00:00 2001
From: Jaroslava Fiedlerova <Jaroslava.Fiedlerova@openairinterface.org>
Date: Wed, 12 Jun 2024 10:25:50 +0200
Subject: [PATCH] Fix integer overflow

Avoid UBSan error:
  openair1/SCHED_NR/phy_procedures_nr_gNB.c:869:43: runtime error: signed integer overflow: 1546663455 + 1635930955 cannot be represented in type 'int'
---
 openair1/PHY/defs_gNB.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h
index 20413098bdd..d5de27aaeee 100644
--- a/openair1/PHY/defs_gNB.h
+++ b/openair1/PHY/defs_gNB.h
@@ -349,7 +349,7 @@ typedef struct {
   /// measured RX noise power
   int ulsch_noise_power[8];
   /// total noise over antennas
-  int ulsch_noise_power_tot;
+  uint32_t ulsch_noise_power_tot;
   /// \brief llr values.
   /// - first index: ? [0..1179743] (hard coded)
   int16_t *llr;
-- 
GitLab