From: Adam Sutton Date: Fri, 16 May 2014 20:30:08 +0000 (+0100) Subject: iptv: fix possible NULL ptr access (fixes #2104) X-Git-Tag: v4.1~2085 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=956a31f1279b87ad96da5f0dc156bce190e0526a;p=thirdparty%2Ftvheadend.git iptv: fix possible NULL ptr access (fixes #2104) --- diff --git a/src/input/mpegts/iptv/iptv.c b/src/input/mpegts/iptv/iptv.c index 1d2b44b39..094de3ad8 100644 --- a/src/input/mpegts/iptv/iptv.c +++ b/src/input/mpegts/iptv/iptv.c @@ -53,7 +53,7 @@ static RB_HEAD(,iptv_handler) iptv_handlers; static int ih_cmp ( iptv_handler_t *a, iptv_handler_t *b ) { - return strcasecmp(a->scheme, b->scheme); + return strcasecmp(a->scheme ?: "", b->scheme ?: ""); } void @@ -210,9 +210,9 @@ iptv_input_start_mux ( mpegts_input_t *mi, mpegts_mux_instance_t *mmi ) } /* Find scheme handler */ - ih = iptv_handler_find(url.scheme); + ih = iptv_handler_find(url.scheme ?: ""); if (!ih) { - tvherror("iptv", "%s - unsupported scheme [%s]", buf, url.scheme); + tvherror("iptv", "%s - unsupported scheme [%s]", buf, url.scheme ?: "none"); return ret; }