Commit fdb82907 authored by Filip Roséen's avatar Filip Roséen Committed by 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's avatarJean-Baptiste Kempf <>
parent e62ab5fc
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment