]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
m3u: fix the NULL dereference if the input string cannot be converted to utf-8, fixes...
authorJaroslav Kysela <perex@perex.cz>
Mon, 4 Feb 2019 09:53:12 +0000 (10:53 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 4 Feb 2019 09:53:16 +0000 (10:53 +0100)
src/misc/m3u.c

index e86abca794c390704c431a4717a74523ebc010dc..6e93f51c366110ae527a9e5813ecb19c441dc3fa 100644 (file)
@@ -161,7 +161,7 @@ htsmsg_t *parse_m3u
           x = get_m3u_str(data + 1, &data, &delim);
           if (*p && *x) {
             y = intlconv_to_utf8safestr(charset_id, x, strlen(x)*2);
-            htsmsg_add_str(item, p, y);
+            htsmsg_add_str(item, p, y ?: ".invalid.charset.");
             free(y);
           }
           get_m3u_str_post(&data, delim);
@@ -180,7 +180,7 @@ htsmsg_t *parse_m3u
       data = until_eol(data);
       if (p && *p) {
         y = intlconv_to_utf8safestr(charset_id, p, strlen(p)*2);
-        htsmsg_add_str(item, "m3u-name", y);
+        htsmsg_add_str(item, "m3u-name", y ?: ".invalid.charset.");
         free(y);
       }
       continue;