]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: fix NULL pointer dereference in dvr_entry_get_epg_running, fixes #4943
authorJaroslav Kysela <perex@perex.cz>
Thu, 15 Feb 2018 18:45:32 +0000 (19:45 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 15 Feb 2018 18:45:32 +0000 (19:45 +0100)
src/dvr/dvr_db.c

index a786e6e10c650933bf3fccf3c45a0cf7dcd42023..67749275c08cdafeffe141eb2da22194712c276f 100644 (file)
@@ -463,11 +463,15 @@ dvr_entry_get_rerecord_errors( dvr_entry_t *de )
 int
 dvr_entry_get_epg_running( dvr_entry_t *de )
 {
+  channel_t *ch;
+
   if (de->de_dvb_eid == 0)
     return 0;
-  if (de->de_channel->ch_epg_running < 0)
+  if ((ch = de->de_channel) == NULL)
+    return 0;
+  if (ch->ch_epg_running < 0)
     return de->de_config->dvr_running;
-  return de->de_channel->ch_epg_running > 0;
+  return ch->ch_epg_running > 0;
 }
 
 /*