]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
api: Fix NULL blank argument.
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Tue, 20 Nov 2018 12:47:08 +0000 (12:47 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sun, 25 Nov 2018 19:54:29 +0000 (20:54 +0100)
The blank argument is NULL on several paths, so fix this to
reference a local variable so we can lookup channel name properly.

src/api/api_epg.c

index 82d4760ce6142924e325e88edefb72f11dd5ceec..b82489d972901791efe379c99b7efef80bc4009a 100644 (file)
@@ -74,7 +74,7 @@ api_epg_add_channel ( htsmsg_t *m, channel_t *ch, const char *blank )
 static htsmsg_t *
 api_epg_entry ( epg_broadcast_t *eb, const char *lang, access_t *perm, const char **blank )
 {
-  const char *s;
+  const char *s, *blank2 = NULL;
   char buf[64];
   channel_t     *ch = eb->channel;
   htsmsg_t *m, *m2;
@@ -85,6 +85,8 @@ api_epg_entry ( epg_broadcast_t *eb, const char *lang, access_t *perm, const cha
 
   if (!ch) return NULL;
 
+  if (blank == NULL)
+    blank = &blank2;
   if (*blank == NULL)
     *blank = tvh_gettext_lang(lang, channel_blank_name);