[vlc-commits] access/satip: fix null-dereference on missing host
Filip Roséen
git at videolan.org
Fri Mar 3 15:59:09 CET 2017
vlc | branch: master | Filip Roséen <filip at atch.se> | Thu Mar 2 20:15:33 2017 +0100| [d934d2659c70083711c0b919c9036f8a20ac2800] | committer: Jean-Baptiste Kempf
access/satip: fix null-dereference on missing host
The module assumes that the vlc_url_t populated by vlc_UrlParse always
have an entry in vlc_url_t::psz_host, which is not the case for
something such as "satip://.invalid:80".
These changes also make sure that we do not accept a URL where an
empty host is specified, as this is not accepted by the SAT>IP
specification.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d934d2659c70083711c0b919c9036f8a20ac2800
---
modules/access/satip.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/access/satip.c b/modules/access/satip.c
index 7653752..a6083c9 100644
--- a/modules/access/satip.c
+++ b/modules/access/satip.c
@@ -658,6 +658,12 @@ static int satip_open(vlc_object_t *obj)
if (psz_host == NULL )
goto error;
+ if (url.psz_host == NULL || url.psz_host[0] == '\0')
+ {
+ msg_Dbg(access, "malformed URL: %s", psz_lower_url);
+ goto error;
+ }
+
msg_Dbg(access, "connect to host '%s'", psz_host);
sys->tcp_sock = net_ConnectTCP(access, psz_host, url.i_port);
if (sys->tcp_sock < 0) {
More information about the vlc-commits
mailing list