From: Adam Sutton Date: Fri, 6 Jul 2012 14:19:12 +0000 (+0100) Subject: Stop addition of channels with empty names. X-Git-Tag: 3.3~219^2~13^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1b73f37bad9c7eaaa919ea0e34304595b64ee665;p=thirdparty%2Ftvheadend.git Stop addition of channels with empty names. --- diff --git a/src/channels.c b/src/channels.c index ad3326303..802787a1d 100644 --- a/src/channels.c +++ b/src/channels.c @@ -164,6 +164,8 @@ channel_create(const char *name, int number) channel_t *ch, *x; int id; + if (!name || !*name) return NULL; + ch = RB_LAST(&channel_identifier_tree); if(ch == NULL) { id = 1; @@ -330,6 +332,8 @@ channel_rename(channel_t *ch, const char *newname) lock_assert(&global_lock); + if (!newname || !*newname) return 0; + if(channel_find_by_name(newname, 0, 0)) return -1; diff --git a/src/dvr/dvr_autorec.c b/src/dvr/dvr_autorec.c index f748f78d4..0a32501cb 100644 --- a/src/dvr/dvr_autorec.c +++ b/src/dvr/dvr_autorec.c @@ -91,7 +91,7 @@ autorec_cmp(dvr_autorec_entry_t *dae, epg_broadcast_t *e) if(dae->dae_title != NULL && dae->dae_title[0] != '\0') { if(e->episode->title == NULL || regexec(&dae->dae_title_preg, e->episode->title, 0, NULL, 0)) - return 0; + return 0; } // Note: ignore channel test if we allow quality unlocking