[vlc-devel] [PATCH] access/satip: add missing initialization of sys->tcp_sock

Filip Roséen filip at atch.se
Fri May 19 22:46:25 CEST 2017

As the object referred to by sys is allocated with calloc,
sys->tcp_sock will be equal to 0 if an error occurs prior to it being
assigned a value in satip_open (such as when encountering a malformed

This will cause the error clean-up to assume that tcp->tcp_sock refers
to an open file-descriptor, triggering an assert if no suck
file-descriptor exists or closing a fd that access/satip definitely
should not mess with.

fixes: #18344
 modules/access/satip.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/access/satip.c b/modules/access/satip.c
index 13527fe7e8..cfbc4677b4 100644
--- a/modules/access/satip.c
+++ b/modules/access/satip.c
@@ -636,6 +636,7 @@ static int satip_open(vlc_object_t *obj)
     sys->udp_sock = -1;
     sys->rtcp_sock = -1;
+    sys->tcp_sock = -1;
     /* convert url to lowercase, some famous m3u playlists for satip contain
      * uppercase parameters while most (all?) satip servers do only understand

More information about the vlc-devel mailing list