]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix issues identified by coverity
authorFlole <flole@flole.de>
Wed, 24 Feb 2021 18:32:16 +0000 (19:32 +0100)
committerFlole <flole@flole.de>
Wed, 24 Feb 2021 18:32:16 +0000 (19:32 +0100)
src/dvr/dvr_config.c
src/dvr/dvr_inotify.c
src/satip/rtp.c

index 234894eb6f084b48356bf7594d00fa561bf1308b..3ca31591bb0eac71a6dc1c9b97aae12251de7e7c 100644 (file)
@@ -115,7 +115,7 @@ dvr_config_find_by_list(htsmsg_t *uuids, const char *name)
         return cfg;
       if (!res) {
         res = dvr_config_find_by_uuid(uuid2);
-        if (!res->dvr_enabled)
+        if (res != NULL && !res->dvr_enabled)
           res = NULL;
       }
     }
index 10f34a08f3ecfde124e2b2d5285b31c3dbd09b03..77ae87caf8534cdaff0cf10016cd65600141b7a6 100644 (file)
@@ -442,7 +442,7 @@ void* _dvr_inotify_thread ( void *p )
     }
     // if unmatched "from", save in case matching "to" is coming in next read
     if (from) {
-      strcpy(from_prev, from);
+      strlcpy(from_prev, from, 255);
       fromfd_prev = fromfd;
       cookie_prev = cookie;
       tvhdebug(LS_DVR_INOTIFY, "i=%d len=%d cookie_prev=%d from_prev=%s fd=%d EOR", i, len, cookie_prev, from_prev, fromfd_prev);
index 3f98a91d8ea9ed6601f1f5de9244335c8fdd6064..a66eea01bd7c1f7fc43be2e9944356c5781b38c5 100644 (file)
@@ -140,8 +140,10 @@ satip_rtp_pmt_cb(mpegts_psi_table_t *mt, const uint8_t *buf, int len)
 
   ol = dvb_table_append_crc32(out, ol, sizeof(out));
 
-  if (ol > 0 && (l = dvb_table_remux(mt, out, ol, &ob)) > 0)
+  if (ol > 0 && (l = dvb_table_remux(mt, out, ol, &ob)) > 0) {
     sbuf_append(&rtp->table_data, ob, l);
+    free(ob);
+  }
 }
 
 static void