From: Jaroslav Kysela Date: Fri, 30 Oct 2015 20:57:12 +0000 (+0100) Subject: IPTV: m3u parser - fix url parser X-Git-Tag: v4.2.1~1722 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb72dbfd6c8535cc75cfb0e6f09adf3934b2c814;p=thirdparty%2Ftvheadend.git IPTV: m3u parser - fix url parser --- diff --git a/src/input/mpegts/iptv/iptv_http.c b/src/input/mpegts/iptv/iptv_http.c index 8b9f4b3e9..29cf12b92 100644 --- a/src/input/mpegts/iptv/iptv_http.c +++ b/src/input/mpegts/iptv/iptv_http.c @@ -148,17 +148,22 @@ iptv_http_complete } urlinit(&u); if (url[0] == '/') { - s = strdupa(im->mm_iptv_url_raw); - if ((p = strchr(s, '/')) != NULL) - *p = '\0'; - if (!urlparse(s, &u)) - goto invalid; url2 = malloc(512); url2[0] = '\0'; if ((p = http_arg_get(&hc->hc_args, "Host")) != NULL) { snprintf(url2, 512, "%s://%s%s", hc->hc_ssl ? "https" : "http", p, url); } else if (im->mm_iptv_url_raw) { + s = strdupa(im->mm_iptv_url_raw); + if ((p = strchr(s, '/')) != NULL) { + p++; + if (*p == '/') + p++; + if ((p = strchr(s, '/')) != NULL) + *p = '\0'; + } + if (!urlparse(s, &u)) + goto invalid; snprintf(url2, 512, "%s%s", s, url); } free(url);