From: Jaroslav Kysela Date: Wed, 17 Jan 2018 18:44:18 +0000 (+0100) Subject: coverity fixes X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8af527f130dae3f26a4b3258233ccbc4a69b5838;p=thirdparty%2Ftvheadend.git coverity fixes --- diff --git a/src/epg.c b/src/epg.c index cf99a37e4..6f7db3bfd 100644 --- a/src/epg.c +++ b/src/epg.c @@ -1153,9 +1153,9 @@ int epg_episode_set_season episode->season = season; if (season) { _epg_season_add_episode(season, episode); - save |= epg_episode_set_brand(episode, season->brand ?: NULL, changed); + epg_episode_set_brand(episode, season->brand ?: NULL, changed); } else { - save |= epg_episode_set_brand(episode, NULL, changed); + epg_episode_set_brand(episode, NULL, changed); } _epg_object_set_updated(episode); save = 1; diff --git a/src/input/mpegts/dvb_psi_hbbtv.c b/src/input/mpegts/dvb_psi_hbbtv.c index 2fe5b11e9..859e8f19a 100644 --- a/src/input/mpegts/dvb_psi_hbbtv.c +++ b/src/input/mpegts/dvb_psi_hbbtv.c @@ -101,7 +101,7 @@ ts_recv_hbbtv_cb(mpegts_psi_table_t *mt, const uint8_t *buf, int len) break; case DVB_DESC_APP_NAME: titles = htsmsg_create_list(); - while (dlen > 4 && l3 > 4) { + while (dlen > 4) { r = dvb_get_string_with_len(title, sizeof(title), dptr + 3, dlen - 3, "UTF-8", NULL); if (r < 0) goto dvberr; tvhtrace(mt->mt_subsys, "%s: lang '%c%c%c' name '%s'", mt->mt_name, dptr[0], dptr[1], dptr[2], title); diff --git a/src/input/mpegts/iptv/iptv.c b/src/input/mpegts/iptv/iptv.c index aadd4b806..97c82b329 100644 --- a/src/input/mpegts/iptv/iptv.c +++ b/src/input/mpegts/iptv/iptv.c @@ -338,7 +338,7 @@ iptv_input_start_mux ( mpegts_input_t *mi, mpegts_mux_instance_t *mmi, int weigh /* Start */ pthread_mutex_lock(&iptv_lock); s = im->mm_iptv_url_raw; - im->mm_iptv_url_raw = strdup(raw); + im->mm_iptv_url_raw = raw ? strdup(raw) : NULL; if (im->mm_iptv_url_raw) { im->mm_active = mmi; // Note: must set here else mux_started call // will not realise we're ready to accept pid open calls diff --git a/src/transcoding/memutils.c b/src/transcoding/memutils.c index 97044fc09..d7ebca85e 100644 --- a/src/transcoding/memutils.c +++ b/src/transcoding/memutils.c @@ -64,6 +64,7 @@ str_vjoin(const char *separator, va_list ap) strcpy(result + result_size - 1, str); result_size += str_len; } else { + str_clear(str); goto reterr; } } diff --git a/src/webui/webui.c b/src/webui/webui.c index 7cf792df2..28682c3d9 100644 --- a/src/webui/webui.c +++ b/src/webui/webui.c @@ -748,8 +748,7 @@ http_channel_list_playlist(http_connection_t *hc, int pltype) channel_t **chlist; int idx = 0, count = 0; char *profile, *hostpath; - const char *name, *blank, *sort; - const char *lang = hc->hc_access->aa_lang_ui; + const char *name, *blank, *sort, *lang; if(hc->hc_access == NULL || access_verify2(hc->hc_access, ACCESS_STREAMING)) @@ -757,6 +756,7 @@ http_channel_list_playlist(http_connection_t *hc, int pltype) hq = &hc->hc_reply; + lang = hc->hc_access->aa_lang_ui; profile = profile_validate_name(http_arg_get(&hc->hc_req_args, "profile")); hostpath = http_get_hostpath(hc); sort = http_arg_get(&hc->hc_req_args, "sort");