From e8cdeeda92343390e0a6f73118df0a808b78f2df Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:17:50 -0400 Subject: [PATCH 01/47] devices/limesdr: Use correct format specifier for channel index Use %zu to print size_t channel indices in error messages. The previous %lu specifier expects unsigned long, which is not guaranteed to match size_t on all platforms. Identified by cppcheck format warnings. Signed-off-by: Robin Getz --- devices/limesdr/devicelimesdr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices/limesdr/devicelimesdr.cpp b/devices/limesdr/devicelimesdr.cpp index a2efec0e4..4eeec1bf9 100644 --- a/devices/limesdr/devicelimesdr.cpp +++ b/devices/limesdr/devicelimesdr.cpp @@ -167,7 +167,7 @@ bool DeviceLimeSDR::SetRFELNA_dB(lms_device_t *device, std::size_t chan, int val { if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0) { - fprintf(stderr, "DeviceLimeSDR::SetRFELNA_dB: cannot set channel to #%lu\n", chan); + fprintf(stderr, "DeviceLimeSDR::SetRFELNA_dB: cannot set channel to #%zu\n", chan); return false; } @@ -207,7 +207,7 @@ bool DeviceLimeSDR::SetRFETIA_dB(lms_device_t *device, std::size_t chan, int val { if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0) { - fprintf(stderr, "DeviceLimeSDR::SetRFETIA_dB: cannot set channel to #%lu\n", chan); + fprintf(stderr, "DeviceLimeSDR::SetRFETIA_dB: cannot set channel to #%zu\n", chan); return false; } @@ -232,7 +232,7 @@ bool DeviceLimeSDR::SetRBBPGA_dB(lms_device_t *device, std::size_t chan, float v { if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0) { - fprintf(stderr, "DeviceLimeSDR::SetRBBPGA_dB: cannot set channel to #%lu\n", chan); + fprintf(stderr, "DeviceLimeSDR::SetRBBPGA_dB: cannot set channel to #%zu\n", chan); return false; } From 3738cd46a6c9daf56d02ea4de28ae84ec870b2f1 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:18:58 -0400 Subject: [PATCH 02/47] devices/perseus: Delete unsupported/unnecessary copy operations Prevent copying or assigning DevicePerseus objects. The existing copy constructor discarded the source state, while the assignment operator performed no assignment, allowing misleading operations that did not preserve object semantics. Identified during static analysis by cppcheck Signed-off-by: Robin Getz --- devices/perseus/deviceperseus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices/perseus/deviceperseus.h b/devices/perseus/deviceperseus.h index 326449c1f..89221937f 100644 --- a/devices/perseus/deviceperseus.h +++ b/devices/perseus/deviceperseus.h @@ -34,8 +34,8 @@ public: protected: DevicePerseus(); - DevicePerseus(const DevicePerseus&) : m_nbDevices(0) {} - DevicePerseus& operator=(const DevicePerseus& other) { (void) other; return *this; } + DevicePerseus(const DevicePerseus&) = delete; + DevicePerseus& operator=(const DevicePerseus&) = delete; ~DevicePerseus(); private: From 7b10626a20ec11e52804ec5242166e566dae2f2c Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:21:32 -0400 Subject: [PATCH 03/47] httpserver: Remove redundant chunked response check Remove the duplicate data size check in HttpResponse::write(). The outer check already ensures data is non-empty before either chunked or non-chunked output is written. Identified by cppcheck. Signed-off-by: Robin Getz --- httpserver/httpresponse.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/httpserver/httpresponse.cpp b/httpserver/httpresponse.cpp index 16341f25c..cbc6a21a5 100644 --- a/httpserver/httpresponse.cpp +++ b/httpserver/httpresponse.cpp @@ -130,14 +130,11 @@ void HttpResponse::write(QByteArray data, bool lastPart) { if (chunkedMode) { - if (data.size()>0) - { - QByteArray size=QByteArray::number(data.size(),16); - writeToSocket(size); - writeToSocket("\r\n"); - writeToSocket(data); - writeToSocket("\r\n"); - } + QByteArray size=QByteArray::number(data.size(),16); + writeToSocket(size); + writeToSocket("\r\n"); + writeToSocket(data); + writeToSocket("\r\n"); } else { From 5e7a45df6dd2d7d74a71868342cfea5d23c2d2e2 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:22:15 -0400 Subject: [PATCH 04/47] modemdab: Validate FIG 2 label field length Check that the assembled label field contains at least three bytes before reading its character-set indicator and flags. Short or malformed label data could otherwise cause out-of-bounds access. Identified by cppcheck. Signed-off-by: Robin Getz --- modemdab/dabensemble.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modemdab/dabensemble.cpp b/modemdab/dabensemble.cpp index e0d0523ee..4e11c8ac9 100644 --- a/modemdab/dabensemble.cpp +++ b/modemdab/dabensemble.cpp @@ -968,6 +968,10 @@ void DABEnsemble::fig2(const uint8_t *data, int length) field.insert(field.end(), label.segments[i].begin(), label.segments[i].end()); } + if (field.size() < 3) { + return; + } + const bool ucs2 = (field[0] & 0x80) != 0; const uint16_t flags = static_cast((field[1] << 8) | field[2]); const int charset = ucs2 ? 6 : 15; From e428c121d0d85f060478089ce5ed8186acb305a1 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:22:57 -0400 Subject: [PATCH 05/47] modemdab: Avoid complex type warning in FFT output copy Cast the output buffer to void* when copying FFTW results into std::complex storage. This avoids GCC's -Wclass-memaccess diagnostic for the destination pointer without changing the copy. Identified by GCC compiler warning. Signed-off-by: Robin Getz --- modemdab/dabfft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modemdab/dabfft.cpp b/modemdab/dabfft.cpp index fe80c3b50..f583bdd4a 100644 --- a/modemdab/dabfft.cpp +++ b/modemdab/dabfft.cpp @@ -85,7 +85,7 @@ void DABFFT::transform(const std::complex *in, std::complex *out) // Through the plan's aligned buffers, so any input and output can be used std::memcpy(m_implementation->in, in, sizeof(fftwf_complex) * m_size); fftwf_execute(m_implementation->plan); - std::memcpy(out, m_implementation->out, sizeof(fftwf_complex) * m_size); + std::memcpy(static_cast(out), m_implementation->out, sizeof(fftwf_complex) * m_size); } const char *DABFFT::backend() From 8565aa221fae056bcd927656e39a24827d2fbd48 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:23:34 -0400 Subject: [PATCH 06/47] modemdab: Match MSC decoder member initialization order Reorder the member initializers to match their declaration order and avoid GCC -Wreorder warnings. Identified by GCC compiler warning. Signed-off-by: Robin Getz --- modemdab/dabmsc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modemdab/dabmsc.cpp b/modemdab/dabmsc.cpp index 7d02839e1..aa31a4b06 100644 --- a/modemdab/dabmsc.cpp +++ b/modemdab/dabmsc.cpp @@ -30,8 +30,8 @@ DABSubchannelDecoder::DABSubchannelDecoder() : m_filled(0), m_lastDamaged(false), m_bitErrors(0), - m_countErrors(true), - m_comparedBits(0) + m_comparedBits(0), + m_countErrors(true) { reset(); } From d558d0ed4383f1950cb2006ded6d111e566ce4f3 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:24:09 -0400 Subject: [PATCH 07/47] modemdab: Fix front-end member initialization order Reorder the carrier power and noise initializers to match member declaration order and avoid GCC -Wreorder warnings. Identified by GCC compiler warning. Signed-off-by: Robin Getz --- modemdab/dabofdm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modemdab/dabofdm.cpp b/modemdab/dabofdm.cpp index 510107657..1131a4030 100644 --- a/modemdab/dabofdm.cpp +++ b/modemdab/dabofdm.cpp @@ -101,9 +101,9 @@ DABFrontEnd::DABFrontEnd() : m_exportCarriers(false), m_filterFFT(FilterFFTSize, false), m_filterIFFT(FilterFFTSize, true), + m_haveCarrierPower(false), m_haveCarrierNoise(false), - m_noiseFrames(0), - m_haveCarrierPower(false) + m_noiseFrames(0) { // Kaiser windowed sinc (beta 7.86 for about 80 dB of stop band attenuation) std::vector> taps(FilterFFTSize, 0.0f); From 9e757b9c93d771a46d0c44d12f27953ebec0e651 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:24:55 -0400 Subject: [PATCH 08/47] modemdr: Validate Journaline data and cleanup iterator Check the data unit length before reading its CRC bytes to prevent out-of-bounds access on truncated input. Check the received-object iterator before dereferencing it during cleanup to avoid invalid iterator access. Identified by cppcheck. Signed-off-by: Robin Getz --- modemdr/journaline.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modemdr/journaline.cpp b/modemdr/journaline.cpp index 57704efc2..32fe64961 100644 --- a/modemdr/journaline.cpp +++ b/modemdr/journaline.cpp @@ -178,9 +178,15 @@ bool JournalineDecoder::push(const std::vector& dataUnit) if (crcPresent) { + if (end < 4U) + { + ++m_invalidDataUnits; + return false; + } + const std::uint16_t crc = static_cast((dataUnit[end - 2U] << 8) | dataUnit[end - 1U]); - if (end < 4U || CRC::crc16(dataUnit.data(), end - 2U) != crc) + if (CRC::crc16(dataUnit.data(), end - 2U) != crc) { ++m_invalidDataUnits; return false; @@ -231,6 +237,10 @@ bool JournalineDecoder::push(const std::vector& dataUnit) } } + if (oldest == m_received.end()) { + break; + } + m_objects.erase(oldest->first); m_received.erase(oldest); } From 169a1c1f1af75bc9a2268934457d8bf72e3c7329 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:25:35 -0400 Subject: [PATCH 09/47] modemdvb: Initialize DVB-T2 post-LDPC block state Value-initialize m_postBlock in the L1Codec constructor to ensure the post-LDPC block state starts initialized. Identified by cppcheck. Signed-off-by: Robin Getz --- modemdvb/dvbt2fec.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modemdvb/dvbt2fec.cpp b/modemdvb/dvbt2fec.cpp index ecc2eded8..abaffefac 100644 --- a/modemdvb/dvbt2fec.cpp +++ b/modemdvb/dvbt2fec.cpp @@ -1045,7 +1045,8 @@ int L1Codec::postTableIndex(L1Constellation constellation) L1Codec::L1Codec() : m_preLDPC(FECType::Short, CodeRate::R1_4), m_postLDPC(FECType::Short, CodeRate::R1_2), - m_bch(FECType::Short, 12) + m_bch(FECType::Short, 12), + m_postBlock() { layout(m_preKsig, m_preKbch, m_preKldpc, 16200 - m_preKldpc, m_preNpunc, m_preGroups, m_preParity, m_preBlock); } From ca971f2ff7b3450dcde641bbb73b9eedd2f4d0fa Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:26:14 -0400 Subject: [PATCH 10/47] modemdvb: Initialize OFDM grid parameters Initialize grid spacing, offset, and amplitude in the OFDMDemod constructor to prevent use of indeterminate member values. Identified by cppcheck. Signed-off-by: Robin Getz --- modemdvb/dvbt2ofdm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modemdvb/dvbt2ofdm.cpp b/modemdvb/dvbt2ofdm.cpp index 94ebc5051..979998aab 100644 --- a/modemdvb/dvbt2ofdm.cpp +++ b/modemdvb/dvbt2ofdm.cpp @@ -108,7 +108,10 @@ OFDMDemod::OFDMDemod(int bandwidthHz, FFTFactory *fftFactory) : m_sampleRate(sampleRate(bandwidthHz)), m_p2Tables(nullptr), m_tables(nullptr), - m_interpolationSpacing(0) + m_interpolationSpacing(0), + m_gridSpacing(0), + m_gridOffset(0), + m_gridAmplitude(0.0f) { m_fft.m_factory = fftFactory; m_p1Fft.m_factory = fftFactory; From 7650709aaa451ed2b819b1388b8c0415934b20b8 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:26:45 -0400 Subject: [PATCH 11/47] modemdvb: Initialize DVB-T TPS bit buffer Zero-initialize m_tpsBits in the modulator constructor so TPS processing does not read indeterminate bit-buffer contents. Identified by cppcheck. Signed-off-by: Robin Getz --- modemdvb/dvbtmodulator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modemdvb/dvbtmodulator.cpp b/modemdvb/dvbtmodulator.cpp index b746ada1d..f2c188ca0 100644 --- a/modemdvb/dvbtmodulator.cpp +++ b/modemdvb/dvbtmodulator.cpp @@ -39,6 +39,7 @@ Modulator::Modulator(Mode mode, Constellation constellation, CodeRate codeRate, m_tables(Tables::get(mode)), m_hierarchy(constellation == Constellation::QPSK ? Hierarchy::None : hierarchy), m_lpCodeRate(lpCodeRate), + m_tpsBits{}, m_symbolIndex(0), m_frameNumber(0) { From e75f7f5e4da8399a1568f4587785eb9824419624 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:27:19 -0400 Subject: [PATCH 12/47] modemdvb: Initialize OFDM demodulator state Initialize ring buffer, smoothing, phase tracking, and TPS state in the OFDM demodulator constructor to prevent use of indeterminate member values. Identified by cppcheck. Signed-off-by: Robin Getz --- modemdvb/dvbtofdm.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modemdvb/dvbtofdm.cpp b/modemdvb/dvbtofdm.cpp index 63b453daa..03428ac59 100644 --- a/modemdvb/dvbtofdm.cpp +++ b/modemdvb/dvbtofdm.cpp @@ -232,7 +232,14 @@ OFDMDemod::OFDMDemod(int bandwidthHz, FFTFactory *fftFactory) : m_guardSize(0), m_symbolSize(0), m_kMax(0), - m_backoff(0) + m_backoff(0), + m_ring{}, + m_smoothingCutoff(0.0), + m_noiseConstellation(Constellation::QPSK), + m_lastSPPhase(0), + m_spPhaseRun(0), + m_tpsSync(0), + m_tpsBits{} { m_fft.m_factory = fftFactory; m_cirFft.m_factory = fftFactory; From 02eb254b0cf5ce4e6b0a491ac7c48655289319d1 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:27:55 -0400 Subject: [PATCH 13/47] modemdvb: Initialize DVB-T outer decoder packet buffer Zero-initialize m_packet in the outer decoder constructor to prevent use of indeterminate packet data. Identified by cppcheck. Signed-off-by: Robin Getz --- modemdvb/dvbtouter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modemdvb/dvbtouter.cpp b/modemdvb/dvbtouter.cpp index 132ce9a28..2805dee92 100644 --- a/modemdvb/dvbtouter.cpp +++ b/modemdvb/dvbtouter.cpp @@ -118,6 +118,7 @@ std::vector OuterDecoder::makePRBS() } OuterDecoder::OuterDecoder() : + m_packet{}, m_prbs(makePRBS()) { for (int j = 0; j < m_interleaverI; j++) { From 0c7da6ee0fe80762f9e32d4356a202f4292e49ed Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:28:43 -0400 Subject: [PATCH 14/47] demod802.15.4: Initialize demodulator receiver state Initialize detector, synchronization, signal statistics, and framer state in the receiver constructor to prevent use of indeterminate member values. Identified by cppcheck. Signed-off-by: Robin Getz --- .../ieee_802_15_4_demodreceiver.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugins/channelrx/demod802.15.4/ieee_802_15_4_demodreceiver.cpp b/plugins/channelrx/demod802.15.4/ieee_802_15_4_demodreceiver.cpp index 7fbe8a942..ed5f3b196 100644 --- a/plugins/channelrx/demod802.15.4/ieee_802_15_4_demodreceiver.cpp +++ b/plugins/channelrx/demod802.15.4/ieee_802_15_4_demodreceiver.cpp @@ -37,6 +37,28 @@ IEEE_802_15_4_DemodReceiver::IEEE_802_15_4_DemodReceiver() : m_nonCoherentLane(true), m_mask(0), m_n(0), + m_waitMax(0.0f), + m_waitMaxN(0), + m_omega(0.0), + m_ncoRef(0), + m_dNext(0), + m_yNext(0), + m_tau(0.0), + m_phi(0.0), + m_dphi(0.0), + m_phaseInit(false), + m_frameStart(0), + m_powerSum(0.0), + m_powerCount(0), + m_qSum(0.0), + m_qCount(0), + m_ampSum(0.0), + m_ampSumSq(0.0), + m_ampCount(0), + m_acquisitionN(0), + m_detectorCleared(false), + m_framers{}, + m_prevECoh(0), m_crcScopeCount(0) { m_stats = Statistics{0, 0, 0, 0, 0, 0}; From 42ba984941dc09a563a85d56dbcb198b9c1751b6 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:29:27 -0400 Subject: [PATCH 15/47] demodapt: Check satellite name before logging Move AOS and LOS debug logging inside the satellite name null checks to prevent dereferencing a null pointer when the API action does not provide a satellite name. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/channelrx/demodapt/aptdemod.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/channelrx/demodapt/aptdemod.cpp b/plugins/channelrx/demodapt/aptdemod.cpp index be6ace9ae..8cb58d99d 100644 --- a/plugins/channelrx/demodapt/aptdemod.cpp +++ b/plugins/channelrx/demodapt/aptdemod.cpp @@ -734,9 +734,9 @@ int APTDemod::webapiActionsPost( { SWGSDRangel::SWGAPTDemodActions_aos* aos = swgAPTDemodActions->getAos(); QString *satelliteName = aos->getSatelliteName(); - qDebug() << "APTDemod::webapiActionsPost - AOS " << *satelliteName; if (satelliteName != nullptr) { + qDebug() << "APTDemod::webapiActionsPost - AOS " << *satelliteName; if (matchSatellite(*satelliteName)) { // Reset for new pass @@ -775,10 +775,10 @@ int APTDemod::webapiActionsPost( { SWGSDRangel::SWGAPTDemodActions_los* los = swgAPTDemodActions->getLos(); QString *satelliteName = los->getSatelliteName(); - qDebug() << "APTDemod::webapiActionsPost - LOS " << *satelliteName; if (satelliteName != nullptr) { + qDebug() << "APTDemod::webapiActionsPost - LOS " << *satelliteName; if (matchSatellite(*satelliteName)) { // Save image From 90caed020e4f843324a172e75104be648c079369 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:30:10 -0400 Subject: [PATCH 16/47] demodapt: Initialize APT line message buffer Value-initialize the MsgLine buffer so its contents are defined before the line data is populated. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/channelrx/demodapt/aptdemod.h | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/channelrx/demodapt/aptdemod.h b/plugins/channelrx/demodapt/aptdemod.h index 0766eba36..b27f5ccf5 100644 --- a/plugins/channelrx/demodapt/aptdemod.h +++ b/plugins/channelrx/demodapt/aptdemod.h @@ -144,6 +144,7 @@ public: MsgLine() : Message(), + m_line{}, m_size(APT_PROW_WIDTH) {} }; From 84017029f0078695aad9d6c030fa0f94b1cc9612 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:30:41 -0400 Subject: [PATCH 17/47] demodapt: Reset scan direction to default Set m_northToSouth to false in resetToDefaults() so resetting APT demodulator settings also initializes the scan direction. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/channelrx/demodapt/aptdemodsettings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/channelrx/demodapt/aptdemodsettings.cpp b/plugins/channelrx/demodapt/aptdemodsettings.cpp index 0bce80ac3..49c68e413 100644 --- a/plugins/channelrx/demodapt/aptdemodsettings.cpp +++ b/plugins/channelrx/demodapt/aptdemodsettings.cpp @@ -50,6 +50,7 @@ void APTDemodSettings::resetToDefaults() m_saveCombined = true; m_saveSeparate = false; m_saveProjection = false; + m_northToSouth = false; m_scanlinesPerImageUpdate = 20; m_transparencyThreshold = 100; m_opacityThreshold = 200; From c0029b63324f35500155ec094217bf992d413be3 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:31:25 -0400 Subject: [PATCH 18/47] demodapt: Delete unsupported sink copy operations Prevent copying or assigning APTDemodSink objects, avoiding accidental duplication of internal processing state and resources. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/channelrx/demodapt/aptdemodsink.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/channelrx/demodapt/aptdemodsink.h b/plugins/channelrx/demodapt/aptdemodsink.h index f7eda42c7..ccf895098 100644 --- a/plugins/channelrx/demodapt/aptdemodsink.h +++ b/plugins/channelrx/demodapt/aptdemodsink.h @@ -45,6 +45,8 @@ class APTDemod; class APTDemodSink : public ChannelSampleSink { public: APTDemodSink(); + APTDemodSink(const APTDemodSink&) = delete; + APTDemodSink& operator=(const APTDemodSink&) = delete; ~APTDemodSink(); virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end); From 206040961286a44872f21ce495e3520ede12d0db Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:32:02 -0400 Subject: [PATCH 19/47] demoddatv/leansdr/dvbs2: Fix FEC decoder writer resource leaks Free the optional bitcount and errcount pipewriters in the s2_fecdec_helper destructor. Both writers are allocated by opt_writer() in the constructor but were never released, causing Coverity resource leak findings (CIDs 652669 and 652407). Delete the writers after killall() has stopped and cleaned up the helper processes, ensuring their resources are released without affecting shutdown processing. Deleting null pointers is safe when the optional output pipes are not configured. Signed-off-by: Robin Getz --- plugins/channelrx/demoddatv/leansdr/dvbs2.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/channelrx/demoddatv/leansdr/dvbs2.h b/plugins/channelrx/demoddatv/leansdr/dvbs2.h index 26b6d9ca7..e70e6fa37 100644 --- a/plugins/channelrx/demoddatv/leansdr/dvbs2.h +++ b/plugins/channelrx/demoddatv/leansdr/dvbs2.h @@ -3712,6 +3712,8 @@ struct s2_fecdec_helper : runnable ~s2_fecdec_helper() { killall(); // also deletes pools[mc][sf].procs if necessary + delete bitcount; + delete errcount; } void run() From df090f119de8ba11e345f60a6b2c97aaefa28e77 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:32:54 -0400 Subject: [PATCH 20/47] demoddvb: Initialize EPG section storage Value-initialize the DVB and Freesat section containers in the EPG constructor to ensure section storage starts in a defined state. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/channelrx/demoddvb/dvbdemodepg.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/channelrx/demoddvb/dvbdemodepg.cpp b/plugins/channelrx/demoddvb/dvbdemodepg.cpp index dfca9cd84..afc2e2c92 100644 --- a/plugins/channelrx/demoddvb/dvbdemodepg.cpp +++ b/plugins/channelrx/demoddvb/dvbdemodepg.cpp @@ -114,6 +114,12 @@ int DVBDemodEPG::eitVersionKey(int sourceTable, int section) } DVBDemodEPG::DVBDemodEPG() : + m_nitSections{}, + m_sdtSections{}, + m_eitSections{}, + m_timeSections{}, + m_freesatSiSections{}, + m_freesatEitSections{}, m_freesatRegion(0), m_networkId(-1), m_transportStreamId(-1), From c7792091d9777459d063eaf2c128c7d74c214247 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:33:30 -0400 Subject: [PATCH 21/47] demodinmarsat: Initialize channel and bit buffer state Initialize the channel pointer to nullptr and zero the bit buffer to prevent use of indeterminate member values during demodulation. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/channelrx/demodinmarsat/inmarsatdemodsink.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/channelrx/demodinmarsat/inmarsatdemodsink.cpp b/plugins/channelrx/demodinmarsat/inmarsatdemodsink.cpp index c4bba48ab..1381be76f 100644 --- a/plugins/channelrx/demodinmarsat/inmarsatdemodsink.cpp +++ b/plugins/channelrx/demodinmarsat/inmarsatdemodsink.cpp @@ -315,6 +315,7 @@ Complex LMSEqualizer::processOneSample(Complex x, bool update, bool training) InmarsatDemodSink::InmarsatDemodSink(InmarsatDemod *stdCDemod) : m_scopeSink(nullptr), m_inmarsatDemod(stdCDemod), + m_channel(nullptr), m_channelSampleRate(InmarsatDemodSettings::CHANNEL_SAMPLE_RATE), m_channelFrequencyOffset(0), m_magsqSum(0.0f), @@ -329,6 +330,7 @@ InmarsatDemodSink::InmarsatDemodSink(InmarsatDemod *stdCDemod) : m_costasLoop(10*2*M_PI/100.0, 2), m_locked(false), m_rrcBufferIndex(0), + m_bits{}, m_sampleBufferIndexA(0), m_sampleBufferIndexB(0) { From ff498fa68f2362a54975f00de8f2de483d4ca767 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:34:29 -0400 Subject: [PATCH 22/47] demodmeshtastic: Initialize network manager before settings Allocate QNetworkAccessManager in the constructor initializer list so applySettings() cannot access it before initialization. Identified by Coverity. Signed-off-by: Robin Getz --- plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp b/plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp index 52b140f76..0ae5aefcc 100644 --- a/plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp +++ b/plugins/channelrx/demodmeshtastic/meshtasticdemod.cpp @@ -82,14 +82,14 @@ MeshtasticDemod::MeshtasticDemod(DeviceAPI* deviceAPI) : m_lastMsgHeaderParityStatus(0), m_lastMsgPayloadCRC(false), m_lastMsgPayloadParityStatus(0), - m_udpSink(this, 256) + m_udpSink(this, 256), + m_networkManager(new QNetworkAccessManager()) { setObjectName(m_channelId); applySettings(m_settings, true); m_deviceAPI->addChannelSink(this); m_deviceAPI->addChannelSinkAPI(this); - m_networkManager = new QNetworkAccessManager(); QObject::connect( this, From b7a57a466862221f91293bfbaaa99b75ca0a2cf7 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:35:00 -0400 Subject: [PATCH 23/47] remotesink: Initialize FIFO size and indices Initialize the FIFO size and read, served, and write indices in the default constructor to prevent use of indeterminate state. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/channelrx/remotesink/remotesinkfifo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/remotesink/remotesinkfifo.cpp b/plugins/channelrx/remotesink/remotesinkfifo.cpp index ea20ca182..6af8440e7 100644 --- a/plugins/channelrx/remotesink/remotesinkfifo.cpp +++ b/plugins/channelrx/remotesink/remotesinkfifo.cpp @@ -18,7 +18,11 @@ #include "remotesinkfifo.h" RemoteSinkFifo::RemoteSinkFifo(QObject *parent) : - QObject(parent) + QObject(parent), + m_size(0), + m_readHead(0), + m_servedHead(0), + m_writeHead(0) {} RemoteSinkFifo::RemoteSinkFifo(unsigned int size, QObject *parent) : From d1b888c9206577e2bd9f217251a9b39235163482 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:35:32 -0400 Subject: [PATCH 24/47] sigmffilesink: Initialize baseband sink state Initialize spectrum sink, GUI message queue, timer, and center frequency members to prevent use of indeterminate state. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/channelrx/sigmffilesink/sigmffilesinkbaseband.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/sigmffilesink/sigmffilesinkbaseband.cpp b/plugins/channelrx/sigmffilesink/sigmffilesinkbaseband.cpp index 607873326..83e1bbf02 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesinkbaseband.cpp +++ b/plugins/channelrx/sigmffilesink/sigmffilesinkbaseband.cpp @@ -31,9 +31,13 @@ MESSAGE_CLASS_DEFINITION(SigMFFileSinkBaseband::MsgConfigureSigMFFileSinkWork, M SigMFFileSinkBaseband::SigMFFileSinkBaseband() : m_channelizer(&m_sink), + m_spectrumSink(nullptr), + m_messageQueueToGUI(nullptr), m_specMax(0), m_squelchLevel(0), - m_squelchOpen(false) + m_squelchOpen(false), + m_centerFrequency(0), + m_timer(nullptr) { qDebug("SigMFFileSinkBaseband::SigMFFileSinkBaseband"); m_sampleFifo.setSize(SampleSinkFifo::getSizePolicy(48000)); From dfbb3f883e2e9e8ca60f12c017e09a1f4c759854 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:36:01 -0400 Subject: [PATCH 25/47] sigmffilesink: Initialize recording sink parameters Initialize sample rates, frequency offsets, center frequency, and device UID to prevent use of indeterminate member values. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/channelrx/sigmffilesink/sigmffilesinksink.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/channelrx/sigmffilesink/sigmffilesinksink.cpp b/plugins/channelrx/sigmffilesink/sigmffilesinksink.cpp index a7b2cfa77..d941e75d7 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesinksink.cpp +++ b/plugins/channelrx/sigmffilesink/sigmffilesinksink.cpp @@ -29,6 +29,10 @@ #include "sigmffilesinksink.h" SigMFFileSinkSink::SigMFFileSinkSink() : + m_channelSampleRate(0), + m_channelFrequencyOffset(0), + m_sinkSampleRate(0), + m_centerFrequency(0), m_preRecordBuffer(48000), m_preRecordFill(0), m_spectrumSink(nullptr), @@ -37,6 +41,7 @@ SigMFFileSinkSink::SigMFFileSinkSink() : m_record(false), m_squelchOpen(false), m_postSquelchCounter(0), + m_deviceUId(0), m_msCount(0), m_byteCount(0) {} From 11775ea7a72f0c4a134783792b5f3adee29da35a Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:36:23 -0400 Subject: [PATCH 26/47] afc: Fix message leak when GUI message queue is unavailable Delete the message when getMessageQueueToGUI() returns null. The message is allocated in updateDeviceSetLists(), but was only transferred to the GUI message queue when the queue existed. Without a queue, the message was never released, causing a resource leak reported by Coverity. Keep the existing behavior of pushing the message to the GUI queue when available, and explicitly delete it otherwise. Signed-off-by: Robin Getz --- plugins/feature/afc/afc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/feature/afc/afc.cpp b/plugins/feature/afc/afc.cpp index 6c292bb14..65b5a5722 100644 --- a/plugins/feature/afc/afc.cpp +++ b/plugins/feature/afc/afc.cpp @@ -317,6 +317,8 @@ void AFC::updateDeviceSetLists() if (getMessageQueueToGUI()) { getMessageQueueToGUI()->push(msg); + } else { + delete msg; } } From f309fc79e3c497ea053e907ba6f8d2e6cdd93bf6 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:37:31 -0400 Subject: [PATCH 27/47] plugins/denoiser: Initialize denoiser buffers and levels Zero-initialize RNNoise, NVIDIA, and VST3 input/output buffers and initialize RMS and output peak levels to prevent use of indeterminate member values. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/feature/denoiser/denoiserworker.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/feature/denoiser/denoiserworker.cpp b/plugins/feature/denoiser/denoiserworker.cpp index 20da5f2c9..bceffe532 100644 --- a/plugins/feature/denoiser/denoiserworker.cpp +++ b/plugins/feature/denoiser/denoiserworker.cpp @@ -46,7 +46,11 @@ DenoiserWorker::DenoiserWorker(QObject *parent) : m_recordSilenceNbSamples(0), m_recordSilenceCount(0), m_nbBytes(0), + m_rnnoiseIn{}, + m_rnnoiseOut{}, m_rnnoiseFill(0), + m_nvidiaIn{}, + m_nvidiaOut{}, m_nvidiaFill(0), m_nvidiaInitAttempted(false), m_nvidiaReady(false), @@ -54,8 +58,12 @@ DenoiserWorker::DenoiserWorker(QObject *parent) : m_nvidiaStatusReported(false), m_nvidiaGeneration(0), m_vst3Effect(nullptr), + m_vst3Input{}, + m_vst3Output{}, m_vst3Fill(0), - m_vst3FailureReported(false) + m_vst3FailureReported(false), + m_rmsLevel(0.0), + m_peakLevelOut(0.0) { m_audioBuffer.resize(4800); m_audioBufferFill = 0; From 1a8071ec066a2cda0a5c8bb4c4ba87c45ccf2e12 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:37:57 -0400 Subject: [PATCH 28/47] morsedecoder: Initialize text report metrics Initialize estimated pitch, speed, signal threshold, and cost function in MsgReportText to prevent indeterminate metric values. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/feature/morsedecoder/morsedecoder.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/feature/morsedecoder/morsedecoder.h b/plugins/feature/morsedecoder/morsedecoder.h index 5e7a1aa62..98d9e474c 100644 --- a/plugins/feature/morsedecoder/morsedecoder.h +++ b/plugins/feature/morsedecoder/morsedecoder.h @@ -171,6 +171,10 @@ public: QString m_text; MsgReportText(const QString& text) : + m_estimatedPitchHz(0.0f), + m_estimatedSpeedWPM(0.0f), + m_signalThreshold(0.0f), + m_costFunction(0.0f), m_text(text) {} }; From 8b67bfa7f8431dcc01ecc6e0d64896109954382b Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:38:25 -0400 Subject: [PATCH 29/47] morsedecoder: Initialize scope GUI pointer Initialize m_scopeGUI to nullptr in the settings constructor to prevent use of an indeterminate pointer value. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/feature/morsedecoder/morsedecodersettings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/feature/morsedecoder/morsedecodersettings.cpp b/plugins/feature/morsedecoder/morsedecodersettings.cpp index e62a0b67f..881cc08b5 100644 --- a/plugins/feature/morsedecoder/morsedecodersettings.cpp +++ b/plugins/feature/morsedecoder/morsedecodersettings.cpp @@ -32,6 +32,7 @@ const QStringList MorseDecoderSettings::m_channelURIs = { }; MorseDecoderSettings::MorseDecoderSettings() : + m_scopeGUI(nullptr), m_rollupState(nullptr) { resetToDefaults(); From fb795bb670478bd7277c982d5593982f633b9a89 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:39:08 -0400 Subject: [PATCH 30/47] satellitetracker: Initialize previous azimuth Initialize prevAz to avoid using an indeterminate azimuth value when checking satellite passes through zero degrees. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/feature/satellitetracker/satellitetrackersgp4.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/feature/satellitetracker/satellitetrackersgp4.cpp b/plugins/feature/satellitetracker/satellitetrackersgp4.cpp index c8afa0f38..3f1956524 100644 --- a/plugins/feature/satellitetracker/satellitetrackersgp4.cpp +++ b/plugins/feature/satellitetracker/satellitetrackersgp4.cpp @@ -198,7 +198,7 @@ bool getPassesThrough0Deg(const QString& tle0, const QString& tle1, const QStrin double timeStep = (losTime - aosTime).TotalSeconds() / steps; - double prevAz; + double prevAz = 0.0; for (int i = 0; i < steps; i++) { // Calculate satellite position From 0a860a0c2ed7c5aee2bf9fe4e717fcabea4665f4 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:39:55 -0400 Subject: [PATCH 31/47] startracker: Initialize horizontal coordinate structures Value-initialize AzAlt and sun right-ascension/declination structures in update() to prevent use of indeterminate coordinate values. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/feature/startracker/startrackerworker.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/feature/startracker/startrackerworker.cpp b/plugins/feature/startracker/startrackerworker.cpp index 5d444ff14..c4f52fa7b 100644 --- a/plugins/feature/startracker/startrackerworker.cpp +++ b/plugins/feature/startracker/startrackerworker.cpp @@ -610,8 +610,8 @@ bool StarTrackerWorker::getRAFromHorizons(const QDateTime &dateTime, RADec &rdJ2 void StarTrackerWorker::update() { - AzAlt aa, sunAA, moonAA; - RADec rdJnow, sunRD, moonRD; + AzAlt aa{}, sunAA{}, moonAA; + RADec rdJnow, sunRD{}, moonRD; bool rdJnowValid = false; double l, b; bool lbTarget = false; @@ -988,7 +988,7 @@ void StarTrackerWorker::update() for (int step = 0; step <= 24*60*60/timestep; step++) { - AzAlt aa; + AzAlt aa{}; RADec rdJnow, rdJ2000; // Calculate elevation of desired object From 3e8337d343a2e22df8aced23d563323c98526c78 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:40:23 -0400 Subject: [PATCH 32/47] samplemimo/limesdrmimo: Initialize thread buffers and decimation Value-initialize both sample buffers and initialize m_log2Decim to prevent use of indeterminate member values. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/samplemimo/limesdrmimo/limesdrmithread.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/samplemimo/limesdrmimo/limesdrmithread.cpp b/plugins/samplemimo/limesdrmimo/limesdrmithread.cpp index 46e244a48..87187cf64 100644 --- a/plugins/samplemimo/limesdrmimo/limesdrmithread.cpp +++ b/plugins/samplemimo/limesdrmimo/limesdrmithread.cpp @@ -24,7 +24,10 @@ LimeSDRMIThread::LimeSDRMIThread(lms_stream_t* stream0, lms_stream_t* stream1, Q m_running(false), m_stream0(stream0), m_stream1(stream1), + m_buf0{}, + m_buf1{}, m_sampleFifo(nullptr), + m_log2Decim(0), m_iqOrder(true) { setObjectName("LimeSDRMI"); From 2893cdf5dfe299f7ea73fa7e19466d0596c1b108 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:40:52 -0400 Subject: [PATCH 33/47] samplemimo/limesdrmimo: Initialize output buffer and interpolation Initialize m_buf to nullptr before allocating the sample buffer and initialize m_log2Interp to prevent use of indeterminate state. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/samplemimo/limesdrmimo/limesdrmothread.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/samplemimo/limesdrmimo/limesdrmothread.cpp b/plugins/samplemimo/limesdrmimo/limesdrmothread.cpp index 4c9e8951c..b9257d87e 100644 --- a/plugins/samplemimo/limesdrmimo/limesdrmothread.cpp +++ b/plugins/samplemimo/limesdrmimo/limesdrmothread.cpp @@ -25,7 +25,9 @@ LimeSDRMOThread::LimeSDRMOThread(lms_stream_t* stream0, lms_stream_t* stream1, Q m_running(false), m_stream0(stream0), m_stream1(stream1), - m_sampleFifo(nullptr) + m_buf(nullptr), + m_sampleFifo(nullptr), + m_log2Interp(0) { qDebug("LimeSDRMOThread::LimeSDRMOThread"); m_buf = new qint16[2*DeviceLimeSDR::blockSize*2]; From a386c1eb0eaebfc8693765a00b97f74ece4192b1 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:41:25 -0400 Subject: [PATCH 34/47] remoteoutput: Initialize FIFO size and indices Initialize the FIFO size and read, served, and write indices in the default constructor to prevent use of indeterminate state. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/samplesink/remoteoutput/remoteoutputfifo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/samplesink/remoteoutput/remoteoutputfifo.cpp b/plugins/samplesink/remoteoutput/remoteoutputfifo.cpp index de0faea5e..4b332eeed 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputfifo.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutputfifo.cpp @@ -18,7 +18,11 @@ #include "remoteoutputfifo.h" RemoteOutputFifo::RemoteOutputFifo(QObject *parent) : - QObject(parent) + QObject(parent), + m_size(0), + m_readHead(0), + m_servedHead(0), + m_writeHead(0) {} RemoteOutputFifo::RemoteOutputFifo(unsigned int size, QObject *parent) : From bfeecb8341caee5c2fbbbb93e1d99595cfac1fa4 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:41:56 -0400 Subject: [PATCH 35/47] remoteoutput: Initialize FEC device index Initialize m_deviceIndex to prevent use of an indeterminate device index before configuration is applied. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/samplesink/remoteoutput/udpsinkfec.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/samplesink/remoteoutput/udpsinkfec.cpp b/plugins/samplesink/remoteoutput/udpsinkfec.cpp index 4f9b40b9c..0dbfca820 100644 --- a/plugins/samplesink/remoteoutput/udpsinkfec.cpp +++ b/plugins/samplesink/remoteoutput/udpsinkfec.cpp @@ -37,6 +37,7 @@ UDPSinkFEC::UDPSinkFEC() : m_txBlockIndex(0), m_frameCount(0), m_sampleIndex(0), + m_deviceIndex(0), m_remoteOutputSender(nullptr), m_senderThread(nullptr), m_remoteAddress("127.0.0.1"), From e275f029a07d452788133649d2b231f98fbd8004 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:42:43 -0400 Subject: [PATCH 36/47] remoteinput: Initialize FEC decoder slot state Initialize decoder block storage, counters, and status flags in DecoderSlot so each slot starts with defined state. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/samplesource/remoteinput/remoteinputbuffer.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/samplesource/remoteinput/remoteinputbuffer.h b/plugins/samplesource/remoteinput/remoteinputbuffer.h index d0a5eafcc..f41afaee1 100644 --- a/plugins/samplesource/remoteinput/remoteinputbuffer.h +++ b/plugins/samplesource/remoteinput/remoteinputbuffer.h @@ -136,7 +136,17 @@ private: int m_recoveryCount; //!< number of recovery blocks received bool m_decoded; //!< true if decoded bool m_metaRetrieved; //!< true if meta data (block zero) was retrieved - DecoderSlot() {} + DecoderSlot() : + m_blockZero{}, + m_originalBlocks{}, + m_recoveryBlocks{}, + m_cm256DescriptorBlocks{}, + m_blockCount(0), + m_originalCount(0), + m_recoveryCount(0), + m_decoded(false), + m_metaRetrieved(false) + {} }; RemoteMetaDataFEC m_currentMeta; //!< Stored current meta data From 5fe695a224a5b76519c771f610c65a9aeaf0399b Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:43:31 -0400 Subject: [PATCH 37/47] sigmffileinput: Set default metadata values Initialize sample count, duration, sample rate, offset, bit depth, and capture and annotation counts in SigMFFileMetaInfo. Identified by cppcheck. Signed-off-by: Robin Getz --- plugins/samplesource/sigmffileinput/sigmffiledata.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/samplesource/sigmffileinput/sigmffiledata.h b/plugins/samplesource/sigmffileinput/sigmffiledata.h index bc4fccd6b..cf9f6d4c1 100644 --- a/plugins/samplesource/sigmffileinput/sigmffiledata.h +++ b/plugins/samplesource/sigmffileinput/sigmffiledata.h @@ -93,7 +93,14 @@ public: unsigned int m_nbCaptures; unsigned int m_nbAnnotations; - SigMFFileMetaInfo() + SigMFFileMetaInfo() : + m_totalSamples(0), + m_totalTimeMs(0), + m_coreSampleRate(0.0), + m_offset(0), + m_rxBits(0), + m_nbCaptures(0), + m_nbAnnotations(0) {} SigMFFileMetaInfo(const SigMFFileMetaInfo& other) : From 032751356d981e4d2e1e5ddc4674582a4dce2f06 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:44:09 -0400 Subject: [PATCH 38/47] sigmffileinput: Initialize worker metadata and sample count Initialize metadata and capture pointers to nullptr and the total sample count to zero, ensuring the worker starts with defined state. Identified by cppcheck. Signed-off-by: Robin Getz --- .../sigmffileinput/sigmffileinputworker.cpp | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/plugins/samplesource/sigmffileinput/sigmffileinputworker.cpp b/plugins/samplesource/sigmffileinput/sigmffileinputworker.cpp index ae8225c12..4334b3357 100644 --- a/plugins/samplesource/sigmffileinput/sigmffileinputworker.cpp +++ b/plugins/samplesource/sigmffileinput/sigmffileinputworker.cpp @@ -35,22 +35,25 @@ SigMFFileInputWorker::SigMFFileInputWorker(std::ifstream *samplesStream, const QTimer& timer, MessageQueue *fileInputMessageQueue, QObject* parent) : - QObject(parent), - m_running(false), + QObject(parent), + m_running(false), + m_metaInfo(nullptr), + m_captures(nullptr), m_currentTrackIndex(0), - m_ifstream(samplesStream), - m_fileBuf(0), - m_convertBuf(0), - m_bufsize(0), - m_chunksize(0), - m_sampleFifo(sampleFifo), - m_samplesCount(0), - m_timer(timer), - m_fileInputMessageQueue(fileInputMessageQueue), + m_ifstream(samplesStream), + m_fileBuf(0), + m_convertBuf(0), + m_bufsize(0), + m_chunksize(0), + m_sampleFifo(sampleFifo), + m_samplesCount(0), + m_totalSamples(0), + m_timer(timer), + m_fileInputMessageQueue(fileInputMessageQueue), m_samplerate(48000), m_accelerationFactor(1), - m_samplesize(16), - m_samplebytes(2), + m_samplesize(16), + m_samplebytes(2), m_throttlems(FILESOURCE_THROTTLE_MS), m_throttleToggle(false), m_sigMFConverter(nullptr) From 789c2a68a0ed929cbaecac0eacc7bde161911adc Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:44:43 -0400 Subject: [PATCH 39/47] dtv: Validate carousel descriptor lengths Check each descriptor length against the remaining user-info bytes before reading its payload or advancing to the next descriptor. This prevents malformed DII data from causing out-of-bounds access. Identified by cppcheck. Signed-off-by: Robin Getz --- sdrbase/dtv/dtvcarousel.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sdrbase/dtv/dtvcarousel.cpp b/sdrbase/dtv/dtvcarousel.cpp index 9bedea766..62252f132 100644 --- a/sdrbase/dtv/dtvcarousel.cpp +++ b/sdrbase/dtv/dtvcarousel.cpp @@ -293,12 +293,20 @@ void DTVCarousel::dii(const uint8_t *m, int length, uint32_t transactionId) const int userInfoLength = ri.u8(); const uint8_t *userInfo = ri.bytes(userInfoLength); - for (int d = 0; userInfo && (d + 2 <= userInfoLength); d += 2 + userInfo[d + 1]) + for (int d = 0; userInfo && (d + 2 <= userInfoLength); ) { + const int descriptorLength = userInfo[d + 1]; + + if (descriptorLength > userInfoLength - d - 2) { + break; + } + // compressed_module_descriptor: compression_method (zlib), original_size if ((userInfo[d] == m_compressedModuleDescriptor) && (userInfo[d + 1] >= 5) && (d + 7 <= userInfoLength)) { originalSize = (int) std::min(0x7FFFFFFF, ((uint32_t) userInfo[d + 3] << 24) | (userInfo[d + 4] << 16) | (userInfo[d + 5] << 8) | userInfo[d + 6]); } + + d += 2 + descriptorLength; } if ((moduleSize > m_maxModuleSize) || (originalSize > m_maxModuleSize)) { From 716620960f14c0a58aff21e62d5bf9050cb30013 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:45:28 -0400 Subject: [PATCH 40/47] dtv: Guard PSI input and partial packet state Reject null or empty input and warn if the partial packet buffer already contains a full packet before calculating remaining space. This prevents invalid input from reaching packet assembly. Identified by cppcheck. Signed-off-by: Robin Getz --- sdrbase/dtv/dtvpsi.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sdrbase/dtv/dtvpsi.cpp b/sdrbase/dtv/dtvpsi.cpp index cfb371bbf..d0172ea47 100644 --- a/sdrbase/dtv/dtvpsi.cpp +++ b/sdrbase/dtv/dtvpsi.cpp @@ -17,11 +17,14 @@ /////////////////////////////////////////////////////////////////////////////////// #include +#include #include "dtv/dtvpsi.h" #include "dtv/dtvsections.h" DTVPSI::DTVPSI() : + m_pat(), + m_nit(), m_transportStreamId(-1) { } @@ -44,9 +47,20 @@ const std::map& DTVPSI::getChannels() const void DTVPSI::feed(const uint8_t *data, int length) { + if (!data || length <= 0) { + return; + } + // Complete a packet split between feeds if (!m_partial.empty()) { + if (m_partial.size() >= 188) + { + qWarning() << "DTVPSI::feed: m_partial size is unexpectedly" + << m_partial.size(); + return; + } + int needed = std::min(188 - (int) m_partial.size(), length); m_partial.insert(m_partial.end(), data, data + needed); data += needed; From cbaa53b6fb384832aeeb8485b31496f894a4bfad Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:46:27 -0400 Subject: [PATCH 41/47] dtv: Explicitly initialize PAT and PMT section containers Default-construct the PAT and PMT section containers in DTVRecorder's constructor. Identified by cppcheck. Signed-off-by: Robin Getz --- sdrbase/dtv/dtvrecorder.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdrbase/dtv/dtvrecorder.cpp b/sdrbase/dtv/dtvrecorder.cpp index d1efd3dd0..587b7fe41 100644 --- a/sdrbase/dtv/dtvrecorder.cpp +++ b/sdrbase/dtv/dtvrecorder.cpp @@ -27,6 +27,8 @@ DTVRecorder::DTVRecorder() : m_mode(Multiplex), m_serviceId(0), m_started(false), + m_patSections(), + m_pmtSections(), m_transportStreamId(-1), m_pmtPid(-1), m_pmtVersion(-1), From fcdb5329e1dfb8569276dd6354c4a16f33be1692 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:47:01 -0400 Subject: [PATCH 42/47] dtv: Initialize UDP datagram buffer Value-initialize m_datagram so its contents are defined before the buffer is filled with received datagram data. Identified by cppcheck. Signed-off-by: Robin Getz --- sdrbase/dtv/dtvudp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sdrbase/dtv/dtvudp.cpp b/sdrbase/dtv/dtvudp.cpp index 87c887ddc..1c46c2eed 100644 --- a/sdrbase/dtv/dtvudp.cpp +++ b/sdrbase/dtv/dtvudp.cpp @@ -25,6 +25,7 @@ DTVUDP::DTVUDP() : m_port(5004), + m_datagram{}, m_datagramFill(0), m_datagrams(0), m_address(QHostAddress::LocalHost), From 39301fc704e4c4f376865f365971d482c04a7708 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:47:34 -0400 Subject: [PATCH 43/47] osndb: Initialize aircraft ICAO field Initialize m_icao to zero when default-constructing AircraftInformation so the identifier starts with a defined value. Identified by cppcheck. Signed-off-by: Robin Getz --- sdrbase/util/osndb.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdrbase/util/osndb.h b/sdrbase/util/osndb.h index 00aa3dfbb..45f647194 100644 --- a/sdrbase/util/osndb.h +++ b/sdrbase/util/osndb.h @@ -56,6 +56,11 @@ struct SDRBASE_API AircraftInformation { QString m_operatorICAO; QString m_registered; + AircraftInformation() : + m_icao(0) + { + } + static void init() { QMutexLocker locker(&m_mutex); From 853309ac6ed66bd3cc9309a3bb9aca8484784af6 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:48:00 -0400 Subject: [PATCH 44/47] sdrbench: Fix memory leaks in FT8 protocol test Free the zeroes and ones arrays at the end of TestFT8Protocols::testOnesZeroes(). Both arrays are dynamically allocated, but were not released after the test completed, resulting in memory leaks reported by Coverity. Use delete[] to release both arrays and match their array allocations, without changing the existing test logic. Signed-off-by: Robin Getz --- sdrbench/test_ft8protocols.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdrbench/test_ft8protocols.cpp b/sdrbench/test_ft8protocols.cpp index 5aa632847..419f165b7 100644 --- a/sdrbench/test_ft8protocols.cpp +++ b/sdrbench/test_ft8protocols.cpp @@ -275,6 +275,8 @@ void TestFT8Protocols::testOnesZeroes(const QStringList& argElements) } qInfo("TestFT8Protocols::testOnesZeroes: (%d,%d) index: zeroes, ones:\n%s", nbBits, bitIndex, qPrintable(s)); + delete[] ones; + delete[] zeroes; } void TestFT8Protocols::testSoftDecode(const QStringList& argElements) From 091cd9d795132a5d912e2da6d786333c1c0123b2 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:48:53 -0400 Subject: [PATCH 45/47] dtvvideoplayer: Initialize video info fields Set default values for video dimensions, audio frame count, and audio-description status to prevent indeterminate report values. Identified by cppcheck. Signed-off-by: Robin Getz --- sdrgui/dtv/dtvvideoplayer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdrgui/dtv/dtvvideoplayer.h b/sdrgui/dtv/dtvvideoplayer.h index 9947e3700..c5047dad2 100644 --- a/sdrgui/dtv/dtvvideoplayer.h +++ b/sdrgui/dtv/dtvvideoplayer.h @@ -88,13 +88,13 @@ public: QString m_videoCodec; //!< FFmpeg's long name QString m_videoDecoder; //!< The GPU's (e.g. CUDA, D3D11VA), or empty if decoded in software QString m_audioCodec; - int m_width; - int m_height; + int m_width = 0; + int m_height = 0; uint64_t m_videoFrames; - uint64_t m_audioFrames; + uint64_t m_audioFrames = 0; uint64_t m_decodeErrors; uint64_t m_lateFrames; //!< Not shown, as they were too late - bool m_audioDescription; //!< Audio description is being mixed in + bool m_audioDescription = false; //!< Audio description is being mixed in uint64_t m_adFrames; //!< Audio description frames decoded int m_adFade; //!< Latest fade of the main audio, from the audio description (0 to 255) bool m_subtitles; //!< A subtitle stream is being decoded From 738b40ff34378e76c67638471972d30def90ebd0 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:49:29 -0400 Subject: [PATCH 46/47] scidoublespinbox: Mark conversion result as unused Explicitly discard the numeric conversion result while retaining the ok status check used to validate the input. Identified by GCC compiler warning. Signed-off-by: Robin Getz --- sdrgui/gui/scidoublespinbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdrgui/gui/scidoublespinbox.cpp b/sdrgui/gui/scidoublespinbox.cpp index 5a0f0d01a..65a94e922 100644 --- a/sdrgui/gui/scidoublespinbox.cpp +++ b/sdrgui/gui/scidoublespinbox.cpp @@ -35,7 +35,7 @@ QValidator::State SciDoubleSpinBox::validate(QString &input, int &pos) const (void) pos; bool ok; - input.toDouble(&ok); + (void) input.toDouble(&ok); if (ok) { return QValidator::Acceptable; } From 1286c6d08860901363ee9fa064d0cfb163337579 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 26 Oct 2026 17:50:15 -0400 Subject: [PATCH 47/47] spectrummeasurements: Use unsigned mask for bit shifts Use 1U when testing mask bits so the left shift is performed on an unsigned value, avoiding signed-shift issues at bit 31. Identified by compiler warning. Signed-off-by: Robin Getz --- sdrgui/gui/spectrummeasurements.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdrgui/gui/spectrummeasurements.cpp b/sdrgui/gui/spectrummeasurements.cpp index 447b29432..56f56626a 100644 --- a/sdrgui/gui/spectrummeasurements.cpp +++ b/sdrgui/gui/spectrummeasurements.cpp @@ -403,7 +403,7 @@ void SpectrumMeasurements::createMaskTable(unsigned memMask) int row = 0; for (int i = 0; i < 32; i++) { - if ((memMask & (1 << i)) != 0) + if ((memMask & (1U << i)) != 0) { m_maskTable->setVerticalHeaderItem(row, new QTableWidgetItem(QString("M%1").arg(i + 1)));