Browse Source

plugins/feature/sid: Guard against null channel in getChannels()

Fix Coverity CID 652299 by checking the result of
mainCore->getChannel() before passing it to getChannelId().
Skip the channel if the lookup returns nullptr.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.1.0
Robin Getz 4 weeks ago
parent
commit
d5f0c19d26
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 3
      plugins/feature/sid/sidsettings.cpp

3
plugins/feature/sid/sidsettings.cpp

@ -645,6 +645,9 @@ void SIDSettings::getChannels(QStringList& ids, QStringList& titles) @@ -645,6 +645,9 @@ void SIDSettings::getChannels(QStringList& ids, QStringList& titles)
if (ChannelWebAPIUtils::getChannelReportValue(deviceSetIndex, channelIndex, "channelPowerDB", power))
{
ChannelAPI *channel = mainCore->getChannel(deviceSetIndex, channelIndex);
if (!channel) {
continue;
}
QString id = mainCore->getChannelId(channel);

Loading…
Cancel
Save