From 67f66e7d6378a12bbd105a67fb133084bdbe5cd2 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 26 Apr 2022 16:29:05 +0200 Subject: [PATCH] radio_dummy: fix potential result overflow by converting to wider type first --- lib/include/srsran/radio/radio_dummy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/include/srsran/radio/radio_dummy.h b/lib/include/srsran/radio/radio_dummy.h index 36e42070b..e5ea2aa5a 100644 --- a/lib/include/srsran/radio/radio_dummy.h +++ b/lib/include/srsran/radio/radio_dummy.h @@ -162,7 +162,7 @@ public: } // Create receiver ring buffers - rx_ring_buffers.resize(args_.nof_carriers * args_.nof_antennas); + rx_ring_buffers.resize(args_.nof_carriers * (size_t)args_.nof_antennas); for (auto& rb : rx_ring_buffers) { if (srsran_ringbuffer_init(&rb, (int)sizeof(cf_t) * TEMP_BUFFER_SZ) != SRSRAN_SUCCESS) { perror("init softbuffer"); @@ -170,7 +170,7 @@ public: } // Create transmitter ring buffers - tx_ring_buffers.resize(args_.nof_carriers * args_.nof_antennas); + tx_ring_buffers.resize(args_.nof_carriers * (size_t)args_.nof_antennas); for (auto& rb : tx_ring_buffers) { if (srsran_ringbuffer_init(&rb, (int)sizeof(cf_t) * TEMP_BUFFER_SZ) != SRSRAN_SUCCESS) { perror("init softbuffer");