vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <[email protected]> | Sun Mar 
22 19:58:21 2015 +0200| [284eecda92a22ed6452f65bf57a9962fee2ef5e7] | committer: 
Rémi Denis-Courmont

Real RTSP: discard unsupported legacy username and password syntax

This is better than leaking them to the DNS resolver. This also avoids
confusing error messages if live555 is missing or failing.

(cherry picked from commit 2e3dee03644cafd3533495a53e1f6e0c1adf839c)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=284eecda92a22ed6452f65bf57a9962fee2ef5e7
---

 modules/access/rtsp/access.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/access/rtsp/access.c b/modules/access/rtsp/access.c
index dd786be..e8b0cec 100644
--- a/modules/access/rtsp/access.c
+++ b/modules/access/rtsp/access.c
@@ -155,6 +155,13 @@ static int Open( vlc_object_t *p_this )
             return VLC_EGENERIC;
     }
 
+    /* Discard legacy username/password syntax - not supported */
+    const char *psz_location = strchr( p_access->psz_location, '@' );
+    if( psz_location != NULL )
+        psz_location++;
+    else
+        psz_location = p_access->psz_location;
+
     p_access->pf_read = NULL;
     p_access->pf_block = BlockRead;
     p_access->pf_seek = Seek;
@@ -179,10 +186,10 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_rtsp->pf_read_line = RtspReadLine;
     p_sys->p_rtsp->pf_write = RtspWrite;
 
-    i_result = rtsp_connect( p_sys->p_rtsp, p_access->psz_location, 0 );
+    i_result = rtsp_connect( p_sys->p_rtsp, psz_location, 0 );
     if( i_result )
     {
-        msg_Dbg( p_access, "could not connect to: %s", p_access->psz_location 
);
+        msg_Dbg( p_access, "could not connect to: %s", psz_location );
         free( p_sys->p_rtsp );
         p_sys->p_rtsp = NULL;
         goto error;

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to