From 98f43dfd8c6de6f4c71f73fc493b5c8d3ca6ca5a Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Sun, 19 Jul 2026 19:21:25 -0400 Subject: [PATCH] FT8: Fix potential integer overflow in band preset frequency calculation Fix Coverity CID 649215 (OVERFLOW_BEFORE_WIDEN) by ensuring the band preset frequency calculation is widened to 64-bit before converting kHz to Hz. This prevents a potential 32-bit intermediate overflow when applying band presets (which is likely not a real issue, but it keeps the analyzer happy). Signed-off-by: Robin Getz --- plugins/channelrx/demodft8/ft8demodgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/channelrx/demodft8/ft8demodgui.cpp b/plugins/channelrx/demodft8/ft8demodgui.cpp index 863068eb9..1d4bc80d7 100644 --- a/plugins/channelrx/demodft8/ft8demodgui.cpp +++ b/plugins/channelrx/demodft8/ft8demodgui.cpp @@ -453,7 +453,7 @@ void FT8DemodGUI::on_applyBandPreset_clicked() int bandPresetIndex = ui->bandPreset->currentIndex(); int channelShift = m_settings.getBandPresets(m_settings.m_decoderMode)[bandPresetIndex].m_channelOffset; // kHz int baseFrequency = m_settings.getBandPresets(m_settings.m_decoderMode)[bandPresetIndex].m_baseFrequency; // kHz - quint64 deviceFrequency = (baseFrequency - channelShift)*1000; // Hz + quint64 deviceFrequency = static_cast(baseFrequency - channelShift) * 1000; // Hz m_ft8Demod->setDeviceCenterFrequency(deviceFrequency, m_settings.m_streamIndex); if (channelShift * 1000 != m_settings.m_inputFrequencyOffset)