[vlc-commits] access/satip: fix 17630: prevent null-pointer dereference
Filip Roséen
git at videolan.org
Sun Nov 13 00:42:28 CET 2016
vlc | branch: master | Filip Roséen <filip at atch.se> | Sat Nov 12 14:36:55 2016 +0100| [fdb829076d84ecef95823b30b9b9f6b1dfdc7015] | committer: Jean-Baptiste Kempf
access/satip: fix 17630: prevent null-pointer dereference
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
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fdb829076d84ecef95823b30b9b9f6b1dfdc7015
---
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);
More information about the vlc-commits
mailing list