From 8fff7f664612c8e67ca5f00a75b6675ee060981a Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 6 Oct 2021 15:30:06 +0200 Subject: [PATCH] Fix potential overflow in rssi_read_cnt --- srsue/src/phy/phy_common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srsue/src/phy/phy_common.cc b/srsue/src/phy/phy_common.cc index 244e0b160..18248166a 100644 --- a/srsue/src/phy/phy_common.cc +++ b/srsue/src/phy/phy_common.cc @@ -687,7 +687,7 @@ void phy_common::update_measurements(uint32_t cc_idx, rx_gain_offset = get_radio()->get_rx_gain() + args->rx_gain_offset; } rssi_read_cnt++; - if (rssi_read_cnt == 1000) { + if (rssi_read_cnt >= 1000) { rssi_read_cnt = 0; } }