From 8deb482f7254d87ca85fd407adeefb0cd89a9062 Mon Sep 17 00:00:00 2001 From: "E.Smith" <31170571+azlm8t@users.noreply.github.com> Date: Sat, 9 Dec 2017 16:48:49 +0000 Subject: [PATCH] codacy: Fix couple of problems identified by codacy. (#4773). Fixed buffer overrun and redundant condition identied by codacy. Issue: #4773. --- src/descrambler/cccam.c | 2 +- src/epggrab/module/xmltv.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/descrambler/cccam.c b/src/descrambler/cccam.c index 8bf7e83f0..9d9a69830 100644 --- a/src/descrambler/cccam.c +++ b/src/descrambler/cccam.c @@ -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); } diff --git a/src/epggrab/module/xmltv.c b/src/epggrab/module/xmltv.c index 3186ddc3e..be498326f 100644 --- a/src/epggrab/module/xmltv.c +++ b/src/epggrab/module/xmltv.c @@ -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); } } -- 2.47.3