From: Flole Date: Wed, 24 Feb 2021 18:32:16 +0000 (+0100) Subject: Fix issues identified by coverity X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe0e5f1f9c8fa175183cede9b3182fb25de2d367;p=thirdparty%2Ftvheadend.git Fix issues identified by coverity --- diff --git a/src/dvr/dvr_config.c b/src/dvr/dvr_config.c index 234894eb6..3ca31591b 100644 --- a/src/dvr/dvr_config.c +++ b/src/dvr/dvr_config.c @@ -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; } } diff --git a/src/dvr/dvr_inotify.c b/src/dvr/dvr_inotify.c index 10f34a08f..77ae87caf 100644 --- a/src/dvr/dvr_inotify.c +++ b/src/dvr/dvr_inotify.c @@ -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); diff --git a/src/satip/rtp.c b/src/satip/rtp.c index 3f98a91d8..a66eea01b 100644 --- a/src/satip/rtp.c +++ b/src/satip/rtp.c @@ -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