[vlc-commits] audioscrobbler: check the submission URLs after handshake

Jonas Lundqvist git at videolan.org
Wed Nov 25 23:25:15 CET 2015


vlc | branch: master | Jonas Lundqvist <jonas at gannon.se> | Mon Nov  9 16:39:42 2015 +0100| [2e4030a28152b2a868b1312f2a6c824193501bec] | committer: Jean-Baptiste Kempf

audioscrobbler: check the submission URLs after handshake

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

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

diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c
index 61252d9..d199bed 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -617,6 +617,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)
@@ -631,6 +637,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;
 



More information about the vlc-commits mailing list