Skip to content

Commit

Permalink
Fix potential null pointer dereferences in ViewScheduled.
Browse files Browse the repository at this point in the history
It shouldn't be possible to get a nullptr in one of the recording
lists, but it if happens the frontend will crash.  Add two nullptr
checks to prevent crashing.
  • Loading branch information
linuxdude42 committed Jul 12, 2023
1 parent 0a5d42e commit d9f9f80
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mythtv/programs/mythfrontend/viewscheduled.cpp
Expand Up @@ -268,6 +268,11 @@ void ViewScheduled::LoadList(bool useExistingData)
while (pit != m_recList.end())
{
ProgramInfo *pginfo = *pit;
if (pginfo == nullptr)
{
pit = m_recList.erase(pit);
continue;
}

pginfo->CalculateRecordedProgress();

Expand Down Expand Up @@ -343,6 +348,8 @@ void ViewScheduled::LoadList(bool useExistingData)
for (int i = listPos; i >= 0; --i)
{
ProgramInfo *pginfo = plist[i];
if (pginfo == nullptr)
continue;
if (callsign == pginfo->GetChannelSchedulingID() &&
startts == pginfo->GetScheduledStartTime())
{
Expand Down

0 comments on commit d9f9f80

Please sign in to comment.