Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
IPTV: fix the mux URL set (NULL pointer dereference)
  • Loading branch information
perexg committed Aug 1, 2014
1 parent b16218a commit 5ee5475
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/input/mpegts/iptv/iptv_mux.c
Expand Up @@ -49,11 +49,11 @@ iptv_mux_url_set ( void *p, const void *v )
free(im->mm_iptv_url_sane);
im->mm_iptv_url = str ? strdup(str) : NULL;
if (im->mm_iptv_url) {
len = strlen(url.scheme) + 3 +
strlen(url.host) + 1 +
len = (url.scheme ? strlen(url.scheme) + 3 : 0) +
(url.host ? strlen(url.host) + 1 : 0) +
/* port */ 16 +
strlen(url.path) + 1 +
strlen(url.query) + 2;
(url.path ? strlen(url.path) + 1 : 0) +
(url.query ? strlen(url.query) + 2 : 0);
buf = alloca(len);
if (url.port)
snprintf(port, sizeof(port), "%d", url.port);
Expand Down

0 comments on commit 5ee5475

Please sign in to comment.