From 882256e96689957122fe00ea93d3d7d323d08b48 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 14 Sep 2026 22:48:30 -0400 Subject: [PATCH] availablechannelorfeature : Initialize members Initialize the indices and object pointer with safe default values so default-constructed AvailableChannelOrFeature instances have defined state before their members are accessed. This prevents undefined behavior from using uninitialized data. Found by cppcheck (uninitMemberVar). Signed-off-by: Robin Getz --- sdrbase/availablechannelorfeature.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdrbase/availablechannelorfeature.h b/sdrbase/availablechannelorfeature.h index a3b9f3dab..077bdbd47 100644 --- a/sdrbase/availablechannelorfeature.h +++ b/sdrbase/availablechannelorfeature.h @@ -27,11 +27,11 @@ struct SDRBASE_API AvailableChannelOrFeature { QChar m_kind; //!< 'R' or 'T' for channel, 'M' for MIMO channel, 'F' for feature as from MainCore::getDeviceSetTypeId - int m_superIndex; //!< Device Set index or Feature Set index - int m_index; //!< Channel or Feature index - int m_streamIndex; //!< For MIMO channels only + int m_superIndex = 0; //!< Device Set index or Feature Set index + int m_index = 0; //!< Channel or Feature index + int m_streamIndex = 0; //!< For MIMO channels only QString m_type; //!< Plugin type (E.g. NFMDemod) - QObject *m_object; //!< Pointer to the object (ChannelAPI or Feature object) + QObject *m_object = nullptr; //!< Pointer to the object (ChannelAPI or Feature object) AvailableChannelOrFeature() = default; AvailableChannelOrFeature(const AvailableChannelOrFeature&) = default;