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

Filip Roséen git at videolan.org
Fri May 19 22:50:56 CEST 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Fri May 19 22:46:25 2017 +0200| [9a613134046754f84bf2499a4a2183c56ff65a5b] | committer: Jean-Baptiste Kempf

access/satip: add missing initialization of sys->tcp_sock

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
URI).

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

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9a613134046754f84bf2499a4a2183c56ff65a5b
---

 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-commits mailing list