From: Jaroslav Kysela Date: Mon, 4 Feb 2019 09:53:12 +0000 (+0100) Subject: m3u: fix the NULL dereference if the input string cannot be converted to utf-8, fixes... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e4cc564cc8ce0b2cfaa55e94e1ee81fa4c6ff9d;p=thirdparty%2Ftvheadend.git m3u: fix the NULL dereference if the input string cannot be converted to utf-8, fixes #5525 --- diff --git a/src/misc/m3u.c b/src/misc/m3u.c index e86abca79..6e93f51c3 100644 --- a/src/misc/m3u.c +++ b/src/misc/m3u.c @@ -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;