Browse Source

sdrgui/gui: Guard against missing website data in loadResource()

Check that m_website is valid before accessing its files,
preventing a null dereference when a resource is found but
the website data is unavailable. Identified by Coverity
CID 657903.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.1.0
Robin Getz 4 weeks ago
parent
commit
145f018fcf
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 2
      sdrgui/gui/websitebrowser.cpp

2
sdrgui/gui/websitebrowser.cpp

@ -391,7 +391,7 @@ QVariant WebsiteBrowser::loadResource(int type, const QUrl& name) @@ -391,7 +391,7 @@ QVariant WebsiteBrowser::loadResource(int type, const QUrl& name)
m_used[url.toString(QUrl::RemoveFragment)] = use(*m_website, url);
}
if (!found.empty())
if (m_website && !found.empty())
{
const auto file = m_website->files.find(found);

Loading…
Cancel
Save