From: Jaroslav Kysela Date: Wed, 1 Nov 2017 15:31:57 +0000 (+0100) Subject: epggrab: channel mapper - handle better empty IDs, fixes #4699 X-Git-Tag: v4.2.5~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47744a8c7b34641b6ccf6dd67e559b814d54572f;p=thirdparty%2Ftvheadend.git epggrab: channel mapper - handle better empty IDs, fixes #4699 --- diff --git a/src/epggrab/channel.c b/src/epggrab/channel.c index 7bbed9751..c2e1d5bfb 100644 --- a/src/epggrab/channel.c +++ b/src/epggrab/channel.c @@ -330,9 +330,6 @@ epggrab_channel_t *epggrab_channel_create { epggrab_channel_t *ec; - if (htsmsg_get_str(conf, "id") == NULL) - return NULL; - ec = calloc(1, sizeof(*ec)); if (idnode_insert(&ec->idnode, uuid, &epggrab_channel_class, 0)) { if (uuid) @@ -350,6 +347,9 @@ epggrab_channel_t *epggrab_channel_create if (conf) idnode_load(&ec->idnode, conf); + if (ec->id == NULL) + ec->id = strdup(""); + TAILQ_INSERT_TAIL(&epggrab_channel_entries, ec, all_link); if (RB_INSERT_SORTED(&owner->channels, ec, link, _ch_id_cmp)) { tvherror(LS_EPGGRAB, "removing duplicate channel id '%s' (uuid '%s')", ec->id, uuid); @@ -367,6 +367,11 @@ epggrab_channel_t *epggrab_channel_find char *s; epggrab_channel_t *ec; + if (id == NULL || id[0] == '\0') { + tvhwarn(LS_EPGGRAB, "%s: ignoring empty EPG id source", mod->id); + return NULL; + } + SKEL_ALLOC(epggrab_channel_skel); s = epggrab_channel_skel->id = tvh_strdupa(id);