[vlc-commits] oldrc: Accept backward compatible hosts

Hugo Beauzée-Luyssen git at videolan.org
Thu Mar 1 10:05:29 CET 2018


vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Feb 28 14:49:43 2018 +0100| [e619c0981061e97b30e23f26691fc8ac251e922d] | committer: Hugo Beauzée-Luyssen

oldrc: Accept backward compatible hosts

Fix #19871

(cherry picked from commit 8c1c9a4322809ccf6b159ed6e5a4fe1e14000272)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=e619c0981061e97b30e23f26691fc8ac251e922d
---

 modules/control/oldrc.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c
index 4f3a43cc63..874fe447f9 100644
--- a/modules/control/oldrc.c
+++ b/modules/control/oldrc.c
@@ -304,6 +304,19 @@ static int Activate( vlc_object_t *p_this )
         vlc_url_t url;
 
         vlc_UrlParse( &url, psz_host );
+        if( url.psz_host == NULL )
+        {
+            vlc_UrlClean( &url );
+            char *psz_backward_compat_host;
+            if( asprintf( &psz_backward_compat_host, "//%s", psz_host ) < 0 )
+            {
+                free( psz_host );
+                return VLC_EGENERIC;
+            }
+            free( psz_host );
+            psz_host = psz_backward_compat_host;
+            vlc_UrlParse( &url, psz_host );
+        }
 
         msg_Dbg( p_intf, "base: %s, port: %d", url.psz_host, url.i_port );
 



More information about the vlc-commits mailing list