]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
codacy: Fix couple of problems identified by codacy. (#4773).
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Sat, 9 Dec 2017 16:48:49 +0000 (16:48 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sun, 10 Dec 2017 15:04:51 +0000 (16:04 +0100)
Fixed buffer overrun and redundant condition identied by codacy.

Issue: #4773.

src/descrambler/cccam.c
src/epggrab/module/xmltv.c

index 8bf7e83f0dba88485c1b43bb06d0949e74db68c8..9d9a69830240834d7022598c0a1e442c3658ea90 100644 (file)
@@ -1111,7 +1111,7 @@ cccam_send_cli_data(cccam_t *cccam)
   memcpy(buf + 20, cccam->cccam_nodeid, 8);
   buf[28] = 0; // TODO: wantemus = 1;
   memcpy(buf + 29, cccam_version_str[cccam->cccam_version], 32);
-  memcpy(buf + 61, "tvh", 32); // build number (ascii)
+  memcpy(buf + 61, "tvh", 3); // build number (ascii)
   cccam_send_msg(cccam, MSG_CLI_DATA, buf, 20 + 8 + 1 + 64, 0, 0, 0);
 }
 
index 3186ddc3e9b4d04d50401245f76cea46d06f7998..be498326f4602bf1e224c51c6531b8b87a8b5873 100644 (file)
@@ -380,7 +380,7 @@ static int _xmltv_parse_date_finished
           year_buf[5] = 0;
           const uint16_t year = atoi(year_buf);
           /* Sanity check the year before copying it over. */
-          if (year && year > 1800 && year < 2500) {
+          if (year > 1800 && year < 2500) {
               return epg_episode_set_copyright_year(ee, year, changes);
           }
       }