[vlc-devel] [PATCH v3 4/4] audioscrobbler: check the submission URLs after handshake

Jonas Lundqvist jonas at gannon.se
Mon Nov 9 16:39:42 CET 2015


---
 modules/misc/audioscrobbler.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c
index fc08687..e941ed1 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -618,6 +618,12 @@ static int Handshake(intf_thread_t *p_this)
 
     vlc_UrlParse(&p_sys->p_nowp_url, psz_url);
     free(psz_url);
+    if (p_sys->p_nowp_url.psz_host == NULL ||
+        p_sys->p_nowp_url.i_port == 0)
+    {
+        vlc_UrlClean(&p_sys->p_nowp_url);
+        goto proto;
+    }
 
     p_buffer_pos = strstr(p_buffer_pos, "http://");
     if (!p_buffer_pos || strlen(p_buffer_pos) == 7)
@@ -632,6 +638,13 @@ static int Handshake(intf_thread_t *p_this)
     /* parse the submission url */
     vlc_UrlParse(&p_sys->p_submit_url, psz_url);
     free(psz_url);
+    if (p_sys->p_submit_url.psz_host == NULL ||
+        p_sys->p_submit_url.i_port == 0)
+    {
+        vlc_UrlClean(&p_sys->p_nowp_url);
+        vlc_UrlClean(&p_sys->p_submit_url);
+        goto proto;
+    }
 
     return VLC_SUCCESS;
 
-- 
2.6.2



More information about the vlc-devel mailing list