[vlc-devel] [PATCH] access/satip: fix 17630: prevent null-pointer dereference

Filip Roséen filip at atch.se
Sat Nov 12 14:36:55 CET 2016


There is nothing that guarantees that vlc_UrlParse will populate
url.psz_host after it has been invoked, as such we need to make sure
that we do not try to strdup with the value if it is NULL.

fixes #17630
---
 modules/access/satip.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/access/satip.c b/modules/access/satip.c
index f22457e..7653752 100644
--- a/modules/access/satip.c
+++ b/modules/access/satip.c
@@ -653,9 +653,10 @@ static int satip_open(vlc_object_t *obj)
     vlc_UrlParse(&url, psz_lower_url);
     if (url.i_port <= 0)
         url.i_port = RTSP_DEFAULT_PORT;
-    if (psz_host == NULL) {
+    if (psz_host == NULL && url.psz_host )
         psz_host = strdup(url.psz_host);
-    }
+    if (psz_host == NULL )
+        goto error;
 
     msg_Dbg(access, "connect to host '%s'", psz_host);
     sys->tcp_sock = net_ConnectTCP(access, psz_host, url.i_port);
-- 
2.10.2



More information about the vlc-devel mailing list