From 6e4cc564cc8ce0b2cfaa55e94e1ee81fa4c6ff9d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 4 Feb 2019 10:53:12 +0100 Subject: [PATCH] m3u: fix the NULL dereference if the input string cannot be converted to utf-8, fixes #5525 --- src/misc/m3u.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.47.2